Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hi, please help me solve the problem, thanks. Question 6 An electronics shop has announced the following seasonal discounts on the purchase of certain items.

Hi, please help me solve the problem, thanks.

image text in transcribed

Question 6 An electronics shop has announced the following seasonal discounts on the purchase of certain items. Purchase Amount Discount on Laptop Discount on Desktop PC 0-250 0.0% 5.0% 251 - 570 5.0% 7.6% 571 - 1000 7.5% 10.0% More than 1000 10.0% 15.0% Write a program based on the above criteria to input name, address, amount of purchase and type of purchase (L for Laptop and D for Desktop) by a customer. Compute and print the net amount to be paid by a customer along with his name and address. (20 Marks) Discount = (discount rate/100)* amount of purchase Net amount = amount of purchase discount Sample output: Enter name: Bella Enter address: Dunearn Enter amount of purchase: $560 Enter type of purchase (L for Laptop/D for Desktop): L Name: Bella Address: Dunearn Net amount: $ 532.00 Do you wish to continue purchase: Y Enter name: Jacob Enter address: Bugis Enter amount of purchase: $800 Enter type of purchase (L for Laptop/D for Desktop): Invalid type of purchase. Do you wish to continue purchase: Y Enter name: Jacob Enter address: Bugis Enter amount of purchase: $800 Enter type of purchase (L Tor Laptop/D Tor Desktop): D Name: Jacob Address: Bugis Net amount: $720.00 Do you wish to continue purchase: m You have exit purchase screen, Goodbye

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

DB2 11 The Database For Big Data And Analytics

Authors: Cristian Molaro, Surekha Parekh, Terry Purcell, Julian Stuhler

1st Edition

1583473858, 978-1583473856

More Books

Students also viewed these Databases questions