Define a structure Ticket that holds data items of a carnival which includes: name of the carnival, total amount of tickets, price per ticket, total tickets sold and total sales. The total sale is based on the price per ticket and total tickets sold. Input the data into structure type variable and print it on the screen.
in c++

3 Years
Discussion Span
Last Post by Shining_1

Start by breaking the problem down.
1. Define a structure named "Ticket"--How do you define a structure in C++?
2. How do you define data items for/in a structure? Define the following:
-name of the carnival
-total amount of tickets
-price per ticket
-total tickets sold
-total sales
3. What is the formula to compute total sale using price per ticket and total tickets sold?
4. How do you use (input the data into) the structure?
5. How do you print the data contained in the structure to the screen?

Edited by cgeier

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.