Mobile phone penetration in South Africa, and, in fact, throughout Africa, is very high, and many...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Mobile phone penetration in South Africa, and, in fact, throughout Africa, is very high, and many users use the pre-paid option to manage how much they spend on phone calls each month. While cost-effective and easy to start with compared to a contract, the downside is that you don't get a phone bill with the breakdown of the costs of the calls. This greatly hampers wise use of one's credit through understanding of one's phone habits. Yet, it is not of the large telecom companies' interest to provide such information to the customers on pre-paid schemes, for they just want to make money. A Cape Town start-up-the Universally Compassionate Telco (UCT) does want the best for its prepaid customers and wants to generate phone records for them in a simple app pre-paid customer then would be able to download. UCT charges for calls according to distance and time of day. The basis of charging is shown in the following table, where the charging step is related to the distance, rather than a flat fee per call. Charging step (distance) A C D E Day rate 8am to 6pm 0.10 0.25 0.53 0.87 1.44 Evening rate Night rate 6pm to 10pm | 10pm to 8am 0.06 0.02 0.05 0.13 0.15 0.33 0.47 0.80 0.17 0.30 All charges are in Rand per minute of the call. Calls that go over a rate boundary are charged according to the time spent in each section. Thus, a call starting at 5:58 pm and terminating at 6:04 pm will be charged for 2 minutes at the day rate and for 4 minutes at the evening rate. Calls less than a minute are not recorded and realistically, one may assume that no call will last more than 24 hours. Write a program that reads call details and calculates the corresponding charges so that a phone record can be sent to the customer. Input The input lines consist of the charging step (upper case letter 'A'.. 'E'), the number called (a string of 7 digits and a hyphen in the approved format) and the start and end times of the call, all separated by exactly one blank. Times are recorded as hours and minutes in the 24 hour clock, separated by one blank and with two digits for each number. Input will be terminated by a line consisting of a single #. Output Output consists of the called number, the time in minutes the call spent in each of the charge categories, the charging step and the total cost. (PTO for sample input and output) Sample input A 183-5724 17 58 18 04 # Sample output 183-5724 2 4 0 A 0.44 Mobile phone penetration in South Africa, and, in fact, throughout Africa, is very high, and many users use the pre-paid option to manage how much they spend on phone calls each month. While cost-effective and easy to start with compared to a contract, the downside is that you don't get a phone bill with the breakdown of the costs of the calls. This greatly hampers wise use of one's credit through understanding of one's phone habits. Yet, it is not of the large telecom companies' interest to provide such information to the customers on pre-paid schemes, for they just want to make money. A Cape Town start-up-the Universally Compassionate Telco (UCT) does want the best for its prepaid customers and wants to generate phone records for them in a simple app pre-paid customer then would be able to download. UCT charges for calls according to distance and time of day. The basis of charging is shown in the following table, where the charging step is related to the distance, rather than a flat fee per call. Charging step (distance) A C D E Day rate 8am to 6pm 0.10 0.25 0.53 0.87 1.44 Evening rate Night rate 6pm to 10pm | 10pm to 8am 0.06 0.02 0.05 0.13 0.15 0.33 0.47 0.80 0.17 0.30 All charges are in Rand per minute of the call. Calls that go over a rate boundary are charged according to the time spent in each section. Thus, a call starting at 5:58 pm and terminating at 6:04 pm will be charged for 2 minutes at the day rate and for 4 minutes at the evening rate. Calls less than a minute are not recorded and realistically, one may assume that no call will last more than 24 hours. Write a program that reads call details and calculates the corresponding charges so that a phone record can be sent to the customer. Input The input lines consist of the charging step (upper case letter 'A'.. 'E'), the number called (a string of 7 digits and a hyphen in the approved format) and the start and end times of the call, all separated by exactly one blank. Times are recorded as hours and minutes in the 24 hour clock, separated by one blank and with two digits for each number. Input will be terminated by a line consisting of a single #. Output Output consists of the called number, the time in minutes the call spent in each of the charge categories, the charging step and the total cost. (PTO for sample input and output) Sample input A 183-5724 17 58 18 04 # Sample output 183-5724 2 4 0 A 0.44
Expert Answer:
Answer rating: 100% (QA)
Below is a simple Python program that takes the described input and produces the corresponding outpu... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Planning is one of the most important management functions in any business. A front office managers first step in planning should involve determine the departments goals. Planning also includes...
-
Identify the process evaluation article that you chose and explain why you selected this example. Describe the purpose of the evaluation, the informants, the questions asked, and the results of the...
-
Laverty Clinic plans to purchase a new centrifuge machine for its New York facility. The machine costs $94,000 and is expected to have a useful life of 6 years, with a terminal disposal value of...
-
Roger inherited 100 shares of Periwinkle stock when his mother, Emily, died. Emily had acquired the stock for a total of $60,000 on November 15, 2012. She died on August 10, 2016, and the shares were...
-
A jar contains 20 pieces of wrapped hard candies, 7 are raspberry, 10 are butterscotch, and 3 are other flavors. Consider 4 successive draws of l piece of candy taken at random from the jar. Suppose...
-
Im gathering some information about the sales/collection process and how it is supposed to work. Okay?
-
Shao Airlines is considering two alternative planes. Plane A has an expected life of 5 years, will cost $100 million, and will produce net cash flows of $30 million per year. Plane B has a life of 10...
-
In the diagram shown to the right, there are two similar triangles. Find the unknown measurement. C= (Simplify your answer.) 90 40 50
-
The mileage (in 1,000s of miles) that car owners get with a certain kind of radial tire is a random variable Y having a lognormal distribution such that Y = eX, where X is normally distributed. Let...
-
Kowona Sdn Bhd is considering of buying a 3-axis moulding machine Acooan, for RM540000. The operating and maintenance costs will be RM65000 for the first year and that they will increase by RM10000...
-
What are the significant positives and negatives of globalization on humanity resources management
-
How would you describe IKEA's overall approach to international expansion? What were some of the important successes and challenges it experienced along the way? Explain International Management?
-
Define overweight and obesity. Discuss strategies for the prevention and control of overweight and obesity in populations
-
What is one example of a produce item that is considered to be a tcs food
-
What are the potential risks with the New HR system of technology and its implementation in the public library?
-
Administrative expenses Borrowings Cash & cash equivalents Deferred taxation provision: 1st April 2018. The following notes are relevant: 1) Land & Buildings Land with a cost of 10 million...
-
You've been asked to take over leadership of a group of paralegals that once had a reputation for being a tight-knit, supportive team, but you quickly figure out that this team is in danger of...
-
You have the option of purchasing electronic editions of many of your college textbooks. Is this something that you are interested in doing?
-
Explain the self-reference criterion (SRC) and its significance to global marketers. Conduct exploratory research and find examples of product failures that might have been avoided through the...
-
Compare and contrast the different forms of countertrade.
-
Bright Horizons Skilled Nursing Facility, an investor-owned company, constructed a new building to replace its outdated facility. The new building was completed on January 1, 2015, and Bright...
-
Great Forks Hospital reported net income for 2015 of \($2.4\) million on total revenues of \($30\) million. Depreciation expense totaled \($1\) million. a. What were total expenses for 2015? b. What...
-
What is the difference between long-term debt and current portions of long-term debt?
Study smarter with the SolutionInn App