output code
--------------------------------------------------------------------------------
please what kind of output code can i use to display the output in the following order; each time there is a new item input.Code:#include <iostream.h> main() { int price,added_stock,qty_of_stock,current_stock,qty_sold,amount_sold,balanced_stock,item,item1,item2,item3,item4,item5; cout<<"enter the item name\t"; cin>>item; cout<<"price\t"; cin>>price; cout<<"added stock\t"; cin>>added_stock; cout<<"qty sold\t"; cin>>qty_sold; cout<<"balanced_stock\t" cin>>balanced_stock; qty_of_stock=added_stock+balanced_stock; amount_sold=qty_sold*price current_stock=qty_of_stock-qty_sold
OUTPUT FORMAT:
ITEM1.....
ADDED STOCK IS.......
QTY OF STOCK IS.......
CURRENT STOCK IS.......
QTY SOLD IS......
PRICE IS.......
AMOUNT SOLD IS.......
THANX
Last edited by kenex; 01-28-2009 at 04:44 AM. Reason: add code tags (the # button)
If you are wanting the original integer to be changed, you must use pointers, that code is also very very messy and hard to read. >_<
You can't declare item three times, nor initialize it to variables that don't exist yet (item1, item2, item3).
I think what you're looking for is:
Also, please use code tags (the # button)Code:cout << "this is static text" << var1 << "\n";
please what kind of statements is suitable 4 d program in order to give the output.since u already know what i'm looking 4.thanx
I just gave you an example. Are you looking for me to finish your assignment for you?
ok,now i understand.thanx
Assuming the above programme gave an output of different item data in different windows,how can i combine the outputs under one window,which of the code?.thanx
i mean combining C++ Source Code Files into one Document without Tabs
Last edited by WingedPanther; 01-28-2009 at 08:20 AM. Reason: triple post
The above code only exists in one file, and produces output in one window, so I'm not clear on what you're asking... perhaps if you posted more of your code it would help.
The above code have a varriable inputs e.g item name,price,added stock,balanced stock,quantity sold.So each time thare is an input of a particular item data,it ouput in one window.so surppose there are different input item data and would not like it to be on a separate window,how do i combine it to be on one window without pressing tabs each time there is an input of a particular item data?
You haven't posted any code that suggests there is anything other than a command line interface. Based on that, I can't really answer your question.
ok,i just have 2 copy and past the number of items i want 2 display on the source file and then run it.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks