Answered step by step
Verified Expert Solution
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 to tickets:
points for the total purchase between $ and $
points for the total purchase greater than $
o Purchase of to tickets:
points for the total purchase between $ and $
points for the total purchase between $ and $
points for the total purchase greater than $
User can only purchase between and tickets.
The tickets price for to tickets purchase is $ per ticket.
The tickets price for to tickets purchase is $ per ticket.
Number of tickets price Points
to $ per ticket points for the total purchase between $
and $
points for the total purchase greater than
$
to $ per ticket points for the total purchase between $
and $
points for the total purchase between $
and $
points for the total purchase greater than
$
User can purchase more than 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 Total set the tax rate as a float constant variable of
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started