How to get a program to display entered information?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • stepup
    New Member
    • Dec 2010
    • 1

    #1

    How to get a program to display entered information?

    I am making a program for a train ticket. I have done it up until the program needs to display the completed ticket. The completed ticket has the following:

    BOARDED AT
    Stop no. _____ Stop name _______________ ___
    No. Adults _____ No. of Children ___ No. of OAP’s ____
    Adult fare _____ Child fare ___ OAP’s fare ____
    Cost Adults _____ Cost Children ___ Cost of OAP’s ____
    Total no. persons _____ Total fares paid ___
    TRAVELLING TO
    Stop no. _____ Stop name _______________ ____

    In the program I have already declared the stops, and no. of children, adult fare etc. But I don't know how I can get the program to show the information already inputted by the user. When it asks for the departure and destination stop no, etc what code to use to be able to show what has already been inputted.
    Also how to display the total of a calculation in the total fare and cost adults as I have already written the calculation within the code.
  • whodgson
    Contributor
    • Jan 2007
    • 542

    #2
    Declare each heading on the ticket as a variable.
    e.g Stop no.(heading) == int stop_no (variable)
    Now the ticket will read:-
    cout<<"Stop no. "<<stop_no< <etc

    Comment

    Working...