Question: Coding question for java. So im making a shopping program and the first thing we get is user input for number of items bought. after

Coding question for java.

So im making a shopping program and the first thing we get is user input for number of items bought.

after that depending on the amount of items bought we need to ask the user for the price of every item ex.

please enter number of items: 2

please enter price of item 1

please enter price of item 2

if the number is less than 1 or greather than a thousand it will reloop and ask the user again for the price.

it also needs to count the number of invalid attempts made by user (invalid being out of bounds from 1 and 1000)

using loops and begginer java knowledge how would one code this. no use of arrays just loops and if else statements etc...

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!