You have an grocery store and you need a program that helps you read the price of the products for each customer. Each customer has three products. Minimum price for each product is 0, and the max price for each product is 77.77. Use a structure called customer. Give the structure 4 members, one for customer ID (it should be an integer), and three for the prices of the products (they should be a decimals). Then, in main, ask for how many customers you will be given the total price of its products. Then, create an array of structures of type Customer. Then, also in main, iterate through each one of them and scan the customers ID and prices. Finally, also in main, print out the customers ID, followed by the final price(the final price is the sum of all three prices). Don't chek if the user inputted a price between 0 and 77.77. You assume the user will always input the price within this range. Everything can be done in main. Output: How many customers will you be helping? 2 Customer 1 ID= 2198262237 Price product one: 15.23 Price product two: 18.54 Price product three: 30.37 Customer 2 ID= 667264646 Price product one: 50.31 Price product two: 42.10 Price product three: 5.39 Customer 1 ID: 2198262237 Total price: 64.14 Customer 2 ID: 667264646 Total price: 97.80||

C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter12: Adding Functionality To Your Classes
Section12.2: Providing Class Conversion Capabilities
Problem 2E
icon
Related questions
Topic Video
Question

Programing C

 

You have an grocery store and you need a program that helps you read the price of the products for each
customer. Each customer has three products. Minimum price for each product is 0, and the max price for each
product is 77.77. Use a structure called customer. Give the structure 4 members, one for customer ID (it
should be an integer), and three for the prices of the products (they should be a decimals). Then, in main, ask
for how many customers you will be given the total price of its products. Then, create an array of structures of
type Customer. Then, also in main, iterate through each one of them and scan the customers ID and prices.
Finally, also in main, print out the customers ID, followed by the final price(the final price is the sum of all
three prices). Don't chek if the user inputted a price between 0 and 77.77. You assume the user will always
input the price within this range. Everything can be done in main.
Output:
How many customers will you be helping? 2
Customer 1
ID= 2198262237
Price product one: 15.23
Price product two: 18.54
Price product three: 30.37
Customer 2
ID= 667264646
Price product one: 50.31
Price product two: 42.10
Price product three: 5.39
Customer 1
ID: 2198262237
Total price: 64.14
Customer 2
ID: 667264646
Total price: 97.80||
Transcribed Image Text:You have an grocery store and you need a program that helps you read the price of the products for each customer. Each customer has three products. Minimum price for each product is 0, and the max price for each product is 77.77. Use a structure called customer. Give the structure 4 members, one for customer ID (it should be an integer), and three for the prices of the products (they should be a decimals). Then, in main, ask for how many customers you will be given the total price of its products. Then, create an array of structures of type Customer. Then, also in main, iterate through each one of them and scan the customers ID and prices. Finally, also in main, print out the customers ID, followed by the final price(the final price is the sum of all three prices). Don't chek if the user inputted a price between 0 and 77.77. You assume the user will always input the price within this range. Everything can be done in main. Output: How many customers will you be helping? 2 Customer 1 ID= 2198262237 Price product one: 15.23 Price product two: 18.54 Price product three: 30.37 Customer 2 ID= 667264646 Price product one: 50.31 Price product two: 42.10 Price product three: 5.39 Customer 1 ID: 2198262237 Total price: 64.14 Customer 2 ID: 667264646 Total price: 97.80||
Expert Solution
steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Instruction Format
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning