Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void main()
- {
- int numTickets;
- float discount;
- float total = 0.0;
- int numKids = 0;
- float ticketPrice = 19.00;
- printf("Enter number of tickets: ");
- scanf("%d", &numTickets);
- if (numTickets > 10)
- {
- discount = 0.15;
- }
- else
- {
- discount = 0.0;
- }
- printf("Enter number of children: ");
- scanf("%d", &numKids);
- total = numKids*ticketPrice/2.0 + (numTickets – numKids)*ticketPrice;
- total = total*(1.0 – discount);
- printf("Total = %.2f n", total);
- }
Add Comment
Please, Sign In to add comment