Question: Question 2 ( 3 0 % ) Write your codes inside Q 2 function block that calculates the total charge under a mobile data plan

Question 2(30%)
Write your codes inside Q2 function block that calculates the total charge under a mobile data plan Plan B according to the table below.
The program should accept the following user inputs in order. Note that NO? prompt messages are needed.
Local data usage (in GB)(a double value)
Roaming data usage (in GB)(a double value)
Local call time (in minutes)(an integer value)
Roaming call time (in minutes)(an integer value)
After receiving the above inputs, the program shows the total charge calculated in two decimal places.
In the calculation, if the total data usage (local + roaming) exceeds 10GB, there is a 10% discount on the total data cost. If the local call time exceeds 1000 minutes, there is a 5% discount on the total call cost.
\table[[Items,Charge for Plan B (per GB or per min)],[Local Data (up to 2GB),$18],[Local Data (2GB to 5 GB ),$13.5
Question 2 ( 3 0 % ) Write your codes inside Q 2

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 Programming Questions!