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++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.5: A Closer Look: Loop Programming Techniques
Problem 13E
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++ 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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,