Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please solve it in java Question 2 You are asked to write a java program to simulate a small shop. First, you need to read

image text in transcribed

Please solve it in java

Question 2 You are asked to write a java program to simulate a small shop. First, you need to read the number of items bought by a client. You should read the price of all items in an array. You should also read the quantity in an array. The program should display the total per item (price * quantity) in an array, Finally, you should display the total bill to be paid by the client. The program stops directly when the user enters an invalid input (negative value or zero). Page 2 of 3 CSCI250L Makeup Final Exam Fall 2020-2021 Sample runi: Enter the number of items : 4 Enter the price for each item: 10 20 5 30 Enter the quantity for each item: 4 3 6 5 The total per item is: 40 60 30 150 The total of your bill is 280$ Sample run2: Enter the number of items: 3 Enter the price for each item: 15 - 6 Invalid input for price Sample run3: Enter the number of items: 4 Enter the price for each item: 50 32 50 60 Enter the quantity for each item: 4 - 2 Invalid input for quantity

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Essentials of Database Management

Authors: Jeffrey A. Hoffer, Heikki Topi, Ramesh Venkataraman

1st edition

133405680, 9780133547702 , 978-0133405682

More Books

Students also viewed these Databases questions

Question

How do Data Types perform data validation?

Answered: 1 week ago

Question

How does Referential Integrity work?

Answered: 1 week ago