Category Item code Phone BPCM Phone BPSH Phone RPSS Phone RPLL Phone YPLS Phone YPLL Tablet RTMS Tablet RTML Tablet YTLM Tablet YTLL SIM card SMNO SIM card SMPG Case CSST Case CSLX Charger CGCR Charger CGHM Description Compact Clam shell Robo phone - 5inch 64GB memory Robo phone - 6inch 256GB memory Y-phone standard 6 inch 64GB memory Y-phone deluxe 6 inch 256GB memory RoboTab - 8 inch screen 64GB memory RoboTab 10 inch screen 128GB memory Y-tab standard - 10 inch screen 128GB memory Y-tab deluxe - 10 inch screen 256GB memory Sim free (no SIM card) Pay as you go (with SIM card) Standard Luxury Car Home Price (S) 29.99 49.99 199.99 499.99 549.99 649.99 149.99 299.99 499.99 599.99 0.00 9.99 0.00 50.00 19.99 15.99
Task:
A shop sells a range of mobile devices, SIM cards and accessories as shown in the table (see screenshot):
Write a program
- Your program or programs must include appropriate prompts for the entry of data; data must be validated on entry.
- Error messages and other output need to be set out clearly and understandably.
- All arrays, variables, constants and other identifiers must have meaningful names.
You will need to complete these three tasks.
Task 1 – Setting up the system.
Write a program to:
- use appropriate data structures to store the item code, description and price information for the mobile devices, SIM cards and accessories;
- allow the customer to choose a specific phone or tablet;
- allow phone customers to choose whether the phone will be SIM Free or Pay As You Go;
- allow the customer to choose a standard or luxury case;
- allow the customer to choose the chargers required (none, one or both may be purchased);
- calculate the total price of this transaction;
- output a list of the items purchased and the total price.
Task 2 – Allow a customer to order multiple mobile devices.
Extend Task 1 to:
- offer the customer the opportunity to purchase an additional mobile device;
- if required, perform bulleted steps 2 to 7 of Task 1 for each additional mobile device and calculate a running total for the customer;
- once no further devices are required, output the total the customer will need to pay.
Task 3 – Offering discounts.
Extend the program to allow a discount of 10% off the price of every additional phone or tablet purchased. Output the new total the customer will need to pay and the amount of money saved.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images
The Offering discounts is not added to the code
Task 3 – Offering discounts.
Extend the program to allow a discount of 10% off the price of every additional phone or tablet purchased. Output the new total the customer will need to pay and the amount of money saved.