Question: You are to design and write an application that simulates the customer interaction and calculations performed at a typical gasoline pump as detailed below. The
You are to design and write an application that simulates the customer interaction and calculations performed at a typical gasoline pump as detailed below.
The application will ask the customer to enter various pieces of data, and depending on the input, will make decisions on further customer interaction, will perform calculations needed for a gasoline sales transaction, and will print a receipt.
As is typical, the application will determine various discounts on the cost of the gasoline based on a customers Reward Points and on whether or not payment will be made using cash or a credit card, along with the type (octane level) and amount of gasoline purchased.
Octane Levels and Base Prices:
For this project, both Octane Levels (type of gasoline) and Price Per Gallon for each level are assumed to be constant: any changes to these values would require the application code to be changed and re- compiled. Note that prices are given in tenths of a penny as is typical for gas stations.
Octane level // price per gallon
89 = 2.509 $
87 = 2.409$
85 = 2.289$
Rewards Points: The price per gallon is discounted for all octane levels by a single amount (cents) depending on the number of Rewards Points a customer has. Points are always whole numbers (no half points). Example: a customer with 4,000 points would have prices: 89=2.359, 87=2.259, 85=2.139.
Number of points //discount amount
less than 1000 = 0.00$
1000 to 1999 = 0.05 $
2000 to 2.999 = 0.10 $
3000 or more = 0.15$
- When Rewards Points are used to discount the price, 500 points are deducted from the total points. - No points are deducted, and no discount received, when the original points are less than 1,000. - Customers who do not use Rewards Points receive no discount on the price per gallon.
Cash Discount:
All customers receive a 2% Cash Discount on their subtotal (price per gallon X number of gallons) when they pay with cash. No Cash Discount is received when a credit card is used.
Rounding Off:
Rounding should be done, when needed, on each individual mathematical operation, not just on the final results. All dollar amounts are rounded to the nearest penny (2 digits past the decimal point), except prices per gallon constants which are 3 digits past the decimal point. So:
Do this:
subtotal = roundoff (price per gallon X number of gallons) cash discount = roundoff (2% of subtotal) total = subtotal cash discount [no roundoff needed]
NOT this:
subtotal = price per gallon X number of gallons cash discount = 2% of subtotal total = roundoff (subtotal cash discount)
Assumptions for Customer Input: Due to the way cout works in C++, you are allowed to make certain assumptions about how customers will respond to questions asked:
A string value >> One or more characters with no blanks (spaces or tabs).
An integer value >>igits only (no decimal point(s) or other characters, including blanks), a number greater than 0.
A floating point value >>Digits only with possibly one decimal point, a number greater than 0.
Specifications:
1. The application first prints a logo...invent a name for your gas station and use your name in the logo.
2. It then asks the customer if they are a rewards customer, with possible responses yes or no. - when the answer is no: Print Ask the attendant about coming one! - when the answer is yes: Ask Enter current rewards points: When the number of points is less than
1,000, print Sorry, not enough points for a discount. - when the answer is anything else, including Yes, YES, NO, No, etc.: Print Invalid input...well assume
you are not.
Print the Prices Per Gallon (including any calculated discount). Ask the customer Enter Octane Level: Example: when the customer is a Rewards Customer with 5,000 points, print:
2.509 0.15 discount 2.409 0.15 discount 2.289 0.15 discount
when the customer enters a number other than 89, 87 or 85: Print Invalid input...well assume 85 Octane.
4. Ask the customer Enter the number of gallons: This may have a decimal point...round this off to 2 digits past the decimal point.
5. Ask the customer Cash or Credit? - when the user enters Cash: print You get a 2% discount of $n.nn
Where n.nn is two percent of the subtotal already calculated. - when the user enters Credit: dont print anything extra. - when the user enters anything besides Cash or Credit (including cash, credit, etc):
Print Invalid input...well assume Credit.


It suppose to look like the above examples
I have worked in this but it didn't worked out.
Here is part of my work

>>This code must type in Visual Studio C++ or Xcode in mac. It has to be in (cpp) type.
cs.uky.edu program that will calculate and... cs.uky /es21 switch statements -C++ Forum Need help with Petrol Stati /pr Chegg Study | Guided Solut 4 Sample Executions: not a rewards customer, using a credit card Invalid answer to both string questions SPEEDY GONZALES GA by Bill Gates SPEEDY GONZALES by Bill Gates Are you a rewards customer? yeso) n Are you a rewards customer? (yeso ) No Ask the attendant about becoming one Inalid inputwe'11 assume you are not. Price Per Gallon: 9 Octane: $2.509 Price Per Gallon: 89 Octane: $2.509 87 Octane $2.409 85 Octane: $2.289 Enter 0ctane Level: Enter number of gallons 10 Cash or Credit? Octane: $2.409 5 Octane: $2.289 87 89 Enterr Octane Leve 1 Enter number of gallons 10 Credit ash or Credit? what? Invalid input...we' ll assume Credit. Speedy GonzalesGas RECEIPT Speedy Gonzales Gas RECEI PT Octane: Ga lIons Price per Gallon:$ Total: 87 10.00 2.409 24.09 ctane allons: 89 10.00 2.509 25.09 Price per Gallon: otal: Press any key to continue _ Press any key to continue _ Rewards, cash (note rewards points deducted) Rewards but not enough points, Credit
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
