Closed Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: output code

  1. #1
    kenex is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    31
    Rep Power
    0

    output code

    output code

    --------------------------------------------------------------------------------
    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
    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.
    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)

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Phoenixz is offline Programming Professional
    Join Date
    Dec 2008
    Posts
    256
    Blog Entries
    1
    Rep Power
    13

    Re: output code

    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. >_<

  4. #3
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: output code

    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:
    Code:
    cout << "this is static text" << var1 << "\n";
    Also, please use code tags (the # button)
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  5. #4
    kenex is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    31
    Rep Power
    0

    Re: output code

    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

  6. #5
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: output code

    I just gave you an example. Are you looking for me to finish your assignment for you?
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  7. #6
    kenex is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    31
    Rep Power
    0
    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

  8. #7
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: output code

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  9. #8
    kenex is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    31
    Rep Power
    0

    Re: output code

    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?

  10. #9
    Join Date
    Jul 2006
    Posts
    16,486
    Blog Entries
    75
    Rep Power
    143

    Re: output code

    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.
    Programming is a branch of mathematics.
    My CodeCall Blog | My Personal Blog

  11. #10
    kenex is offline Learning Programmer
    Join Date
    Dec 2008
    Posts
    31
    Rep Power
    0

    Re: output code

    ok,i just have 2 copy and past the number of items i want 2 display on the source file and then run it.

Closed Thread
Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. No output on simple code: learning ArrayList class
    By scottbomb in forum Java Help
    Replies: 3
    Last Post: 06-08-2011, 06:46 PM
  2. Replies: 2
    Last Post: 12-08-2010, 01:45 PM
  3. Help fix the output
    By 450081592 in forum Java Help
    Replies: 8
    Last Post: 11-20-2009, 10:51 PM
  4. Replies: 61
    Last Post: 06-05-2009, 07:15 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts