Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Solve using MATLAB, im having the most difficulty with having the user input the option again if it is not one of the three options
Solve using MATLAB,
im having the most difficulty with having the user input the option again if it is not one of the three options
2. Write a program in a script file that calculates the cost of a telephone call according to the following price schedule: Duration of the Call S0.10/min $1.00+80.08/min forS2.60+80.06/min for S0.07/min 80.70+80.05/min forS1.70+80.04/min for S0.04/min S0.40+80.03/min forS1.00+80.02/min for Time the Call is Made 1-10min 10-30 min > 30 min Day: 8am-6pm Evening 6pm-12am Night 12am-8am additional min above 10 additional min above 30 additional min above 10 additional min above 30 additional min above 10 additional min above 30 The program asks the user to enter the time the call is made (day, evening, or night). If the user enters something other than these three options, it asks the user to enter the input for the time of the call again. The program also asks the user to enter the duration of the call. If the input is negative, it asks the user to enter the duration of the call again. If the duration of the call is not an integer, the program rounds up the duration to the next integer. The program then displays the cost of the call. Run the program three times for the following calls (a) 8.3 min during the day (b) 34.5 min during the evening (c) 29.6 min during the night Solution: (a) S0.90 (b) S1.90 (c) S1.00Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started