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...
-
Suppose that short-term municipal bonds currently offer yields of 4%, while comparable taxable bonds pay 5%. Which gives you the higher after-tax yield if your tax bracket is: a. Zero b. 10% c. 20%...
-
WannaDance Corporation is considering issuing common shares. Their market price is currently $73.50, but the firm would like to verify the offering price. The following data is available: Beta 1.14...
-
Cotton, Corp., uses the allowance method to account for uncollectible accounts. On May 31,2010, Allowance for Uncollectible Accounts has a $1,300 credit bal ance. Journalize the year-end adjusting...
-
Last year, Lakeshas Lounge Furniture Corporation had an ROE of 17.5 percent and a dividend payout ratio of 20 percent. What is the sustainable growth rate?
-
The Ontario Line will be a 15.6-kilometre subway line that will make it faster and easier to travel within Toronto and beyond. The line will bring 15 new stations to the city and will run from...
-
The plots below show sampling distributions of p-values for different values of power. Match the distribution to the power. Please note that for this problem, you must pick values of power for all...
-
10 mH inductor to design a low-pass passive filter with a cutoff frequency of 1600 . a) Specify the cutoff frequency in hertz. b) Specify the value of the filter resistor. c) Assume the cutoff...
-
friends who watch NBA basketball once a week. I have 20 friends who do not watch NBA basketball once a week. (a) What are the odds that a given friend watches NBA basketball once a week? (b) What is...
-
The SUS is made up of a series of services, which have different and complementary objectives, but always with a focus on health and following the principles and guidelines recommended by law...
-
Health care systems are deliberate social responses according to the health needs of the population. Thus, when discussing a proposal for organizing a care model in the Unified Health System (SUS),...
-
The Ravenville City Council passed an ordinance revising the hiring criteria for public transportation workers. The criteria apply only to those who operate and maintain public transportation...
-
You are a manager at Northern Fibre, which is considering expanding its operations in synthetic fibre manufacturing. Your boss comes into your office, drops a consultant's report on your desk, and...
-
A kinematic chain is known as a mechanism when Select one: A. one link is fixed B. Three links is fixed C. two links is fixed D. none of the links is fixed
-
As you rewrite these sentences, replace the cliches and buzzwords with plain language (if you don't recognize any of these terms, you can find definitions online): a. Being a jack-of-all-trades, Dave...
-
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.
-
What is a post-mortem?
-
A __________ is another name for a project close-out meeting A. celebration B. post project C. final review D. post mortem
-
What advice about project closing is most useful to you? What other advice would you add?
Study smarter with the SolutionInn App