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++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter5: Repetition Statements
Section5.6: Nested Loops
Problem 5E: (Mathematical functions) Write a program that calculates and displays values for y when y=xz/(xz)...
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++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT