Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Can someone please help me? i am so lost. this is in C++ by the way. Thanks! Write a program named receipt.cpp that: Prompts the
Can someone please help me? i am so lost. this is in C++ by the way. Thanks!
Write a program named receipt.cpp that: Prompts the user for the names of 3 one-word items and their corresponding prices in US dollars Makes sure each price is not negative or greater than $999.99 (if invalid input is entered, then output an error message and terminate the program) Makes sure the length of each item name is not 10 or greater (if invalid input is entered, then output an error message and terminate the program) Calculates the total price and displays a well-formatted receipt Refer to the sample output for an example of proper formatting. Task 2 Sample Output - User Enters a Bad Name Enter names of 3 one-word items to purchase (each name must be less than 10 letters long): Gum Television This item is 10 or more letters long Task 2 Sample Output - Invalid Price Enter names of 3 one-word items to purchase (each name must be less than 10 letters long): Gum Diamonds Oranges You have purchased 3 items. Enter their prices in US Dollars (must be less than $1,000): 0.75 4500 You entered an invalid price Task 2 Sample Output - Good Run Enter names of 3 one-word items to purchase (each name must be less than 10 letters long): Gum Flour Oranges You have purchased 3 items. Enter their prices in US Dollars (must be less than $1,000): 0.75 6.00 19.99 1 RECEIPT Gum Flour Oranges I$ 0.75 1$ 6.001 1$ 19.99 TOTAL: $ 26.74 1 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