subject

(Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for up to 10 hours of connection time. Additional hours or partial hours are charged at $1.99 each.
Write a function charges that computes the total charge for a customer based on the number of hours of
connection time used in a month. The function should also calculate the average cost per hour of the time
used (rounded to the nearest 0.01), so use two output parameters to send back these results.
You should write a second function
round_money that takes a real number as an input argument and returns as the function value the number
rounded to two decimal places. Write a main function that takes data from an input file usage. txt and
produces an output file charges. txt. The data file format is as follows:
Line 1: current month and year as two integers
Other lines: customer number (a five-digit number) and number of hours used
Here is a sample data file and the corresponding output file:
Data file usage. txt
10 2009
15362 4.2
42768 11.1
11111 9.9
Output file charges. txt
Charges for 10/2009
15362 4.2 7.99 1.90
42768 11.1 10.18 0.92
11111 9.9 7.99 0.81

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 19:30
Anul 2017 tocmai s-a încheiat, suntem trişti deoarece era număr prim, însă avem şi o veste bună, anul 2018 este produs de două numere prime, 2 şi 1009. dorel, un adevărat colecţionar de numere prime, şi-a pus întrebarea: “câte numere dintr-un interval [a,b] se pot scrie ca produs de două numere prime? “.
Answers: 1
question
Computers and Technology, 24.06.2019 01:30
How can you make your column headings stand out?
Answers: 1
question
Computers and Technology, 24.06.2019 10:20
Identify the publisher in this citation: carter,alan.a guide to entrepreneurship.new york: river’2008.print.
Answers: 3
question
Computers and Technology, 24.06.2019 15:30
During the software planning process, rick, a project manager, finds that his team has made an incorrect estimation of funds. what kind of risk has rick identified? rick has identified a risk.
Answers: 1
You know the right answer?
(Wattan Corporation) is an Internet service provider that charges customers a flat rate of $7.99 for...
Questions
question
Mathematics, 18.10.2020 16:01
question
Biology, 18.10.2020 16:01
question
Mathematics, 18.10.2020 16:01
Questions on the website: 13722363