By using while loop OR do..while loop, write a program that displays a list of groceries. Then, allow user to insert number of product that they want to buy, the item's code and quantity for each item. Finally, display the total price that the user needs to pay. Valid input for the number of product and quantity is positive number. Meanwhile valid number for items' code is only from 1 to 4. 1 Cooking oil 2 Curry powder RM 3.40 3 Detergent 4 Potato chips RM 2.50 RM 8.50 RM 3.20

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 22PE
icon
Related questions
Question

in c++ 

Question 2
By using while loop OR do..while loop, write a program that displays a list of groceries. Then, allow user to
insert number of product that they want to buy, the item's code and quantity for each item. Finally, display the
total price that the user needs to pay. Valid input for the number of product and quantity is positive number.
Meanwhile valid number for items' code is only from 1 to 4.
1 Cooking oil
2 Curry powder RM 3.40
3 Detergent
Potato chips
RM 2.50
RM 8.50
RM 3.20
Transcribed Image Text:Question 2 By using while loop OR do..while loop, write a program that displays a list of groceries. Then, allow user to insert number of product that they want to buy, the item's code and quantity for each item. Finally, display the total price that the user needs to pay. Valid input for the number of product and quantity is positive number. Meanwhile valid number for items' code is only from 1 to 4. 1 Cooking oil 2 Curry powder RM 3.40 3 Detergent Potato chips RM 2.50 RM 8.50 RM 3.20
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Program on Numbers
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++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,