Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Create a C + + code that will calculate the total price for purchasing some tickets. The program has the following requirement: The user can

Create a C++ code that will calculate the total price for purchasing some
tickets. The program has the following requirement:
The user can earn points depending on the total price of the tickets.
o Purchase of 1 to 5 tickets:
10 points for the total purchase between $130 and $389
13 points for the total purchase greater than $390
o Purchase of 6 to 20 tickets:
15 points for the total purchase between $550 and $1099.
20 points for the total purchase between $1100 and $1649.
30 points for the total purchase greater than $1650
User can only purchase between 1 and 20 tickets.
The tickets price for 1 to 5 tickets purchase is $130 per ticket.
The tickets price for 6 to 20 tickets purchase is $110 per ticket.
Number of tickets price Points
1 to 5 $130 per ticket 10 points for the total purchase between $130
and $389
13 points for the total purchase greater than
$390
6 to 20 $110 per ticket 15 points for the total purchase between $550
and $1099.
20 points for the total purchase between $1100
and $1649.
30 points for the total purchase greater than
$1650
21+ User can purchase more than 20 tickets
Negative number of
tickets
User has entered an invalid number of tickets
Hint: the assignment of points is set as nested conditional statement.
Calculate the total price to pay using the following formula:
Total = number of tickets * ticket price
NY tax =(tax rate /100)* Total -> set the tax rate as a float constant variable of 8.16
Total price = Total + NY tax -> total price is rounded off to two decimal places.
After collecting all information and calculated the total price, the program should prompt:
----- username the total to pay is -----
Total number of tickets
_______
Total price $
_______
NY tax $
_______
--------------------------------------------
TOTAL TO PAY $
_______
Total points earned ________

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M Ricardo, Susan D Urban

3rd Edition

1284056945, 9781284056945

More Books

Students also viewed these Databases questions