Chapter 4 material Java (demonstrating a simple loop and a nested if statement.) You are writing a billing program that adds up the items a user enters. Your program should use a loop and prompt the user for the item number for each item in inventory to add to the bill. (You can ask the user for the number of items you will enter and use a counter controlled loop or a sentinel controlled loop that has a stop number. Either way is fine.) Here is the table of items in inventory: Item Value 1 101.00 2 119.25 3 160.75 4 203.00 5 109.12  (So if your program starts asking the user for the items they are purchasing and they enter item 2 with quantity 2, and item 3 with quantity 1. The bill should be 399.25. On the next run if your program asks the user for items in the loop and they give enter each item with quantity of 1. The bill should be 693.12. [You must use an IF or IF/Else Structure to look up the item value for the item number they give or you are missing an objective on this assignment.]

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 27PE
icon
Related questions
Question
Chapter 4 material Java (demonstrating a simple loop and a nested if statement.)
You are writing a billing program that adds up the items a user enters. Your program should use a loop and prompt the user for the item number for each item in inventory to add to the bill. (You can ask the user for the number of items you will enter and use a counter controlled loop or a sentinel controlled loop that has a stop number. Either way is fine.) Here is the table of items in inventory:
Item Value
1 101.00
2 119.25
3 160.75
4 203.00
5 109.12
 (So if your program starts asking the user for the items they are purchasing and they enter item 2 with quantity 2, and item 3 with quantity 1. The bill should be 399.25. On the next run if your program asks the user for items in the loop and they give enter each item with quantity of 1. The bill should be 693.12.
[You must use an IF or IF/Else Structure to look up the item value for the item number they give or you are missing an objective on this assignment.]
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
Types of Loop
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