We all will agree that along with other essential workers, IT personnel have been working hard from their homes to enable smooth functioning of our so-called essential apps like YouTube, Facebook, Instagram, Zoom and all other commercial/non-commercial software.

This makes LAPTOP a necessity in a situation like these. Assuming that there is a major requirement of computer systems in Punjab, a vendor of our holy city is proposing a delivery system which will work on the following conditions:

PROBLEM STATEMENT:

An entrepreneur, who deals in laptops, has got the pass to open two of his showrooms. He wants to sell these laptops at best price.

i) Location of the stores :- VR Ambarsar and Mall of Amritsar. Each of the stores initially store 100 laptops.

ii) Laptops at VR Ambarsar are sold at 1000$/unit and at Mall of Amritsar they are sold at 500$/unit.

iii) 100 units are added back to the stock if the laptop count goes below 30.

iv) The number of laptops ordered should be only in multiples of 10(i.e. number of laptops ordered should not be in number like 23,157 etc.)

v) The order placed should be either fulfilled completely or nothing.

vi) If the order placed is more than that available in the stock, the remaining laptops can be delivered from the other showroom subject to the following conditions:

a. VR Ambarsar showroom can ask Mall of Amritsar showroom to fulfill its order but not vice versa.

b. Delivery cost is charged 400$ [from Mall of Amritsar] per 10 units.

vii) The program should not exit till the user wants to exit.

SAMPLE INPUT/OUTPUT

The output of your program should be like:

Choose the Store location from where you want to buy laptops:

1. VR Ambarsar

2. Mall of Amritsar

Enter your Choice (1/2) : 1

Enter the number of laptops (in multiples of 10)

20

Total Cost : $ 20000

Delivery charges: $ 0

Net Amount : $ 20000

Laptops left at VR Ambarsar : 80

Laptops left at Mall of Amritsar : 100

No refilling required.

Do you want to place another order?

1. No

2. Yes

Enter your choice (1/2) :

2

Choose the Store location from where you want to buy laptops:

1. VR Ambarsar

2. Mall of Amritsar

Enter your Choice (1/2) : 1

Enter the number of laptops (in multiples of 10)

90

Total Cost : $ 85000

Delivery charges: $ 400

Net Amount : $ 85400

Laptops left at VR Ambarsar : 0

Laptops left at Mall of Amritsar : 90

Refilling required at VR Ambarsar Showroom

After refilling, Laptops left at VR Ambarsar : 100

Do you want to place another order?

1. No

2. Yes

Enter your choice (1/2) :

1

You can email your solutions at training@core-solutions.in or join our WhatsApp community group to participate in discussion. We share monthly coding tasks and information that is valuable for both students and teachers. Our Community is a knowledge-sharing arena for students, teachers and professionals; an attempt to bridge the skill-gap between the academic institutions and the companies. JOIN NOW

For further queries, contact +91 7888671751.

Check out task for the month of May.

Winners of the competition:
1. Shivya Aggarwal ( 3rd year, MCA-FYIC, GNDU Amritsar)
2. Prerna Malhotra ( 4th year, MCA-FYIC, GNDU Amritsar)