Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

You have decided to look in to changing your cell phone service because you keep going over the free minutes limit and the per minute

You have decided to look in to changing your cell phone service because you keep going over the free minutes limit and the per minute charges are costing you big time. The two service providers you have been looking at are Jog and Holo-T. Both services have the same number of free minutes, but charge differently for calls in excess of that limit. Your phone lets you download the data for each call you make in excess of your free minutes to your computer, so you decide to write a program to calculate how much it would cost you for a typical month using each of these services. (You can find a sample data file in ~ee160/Homework/Hw1/cell.dat). Jog charges you $0.05 per minute for each excess minute. However, they calculate your excess minutes by rounding each call to the nearest minute and adding up the total. Holo-T charges you $0.07 per excess minute. However, they caclulate your excess minutes by adding the total of all your excess calls, and then rounding the total to the nearest minute. Write a program that reads the data from a file (redirected on the command line), and computes the cost for each of the cell phone companies. You will run the program with a command like: a.out < cell.dat Call the file with your source code cell.c. Use the round_to_int() function from problem 1 to do the appropriate rounding in your program.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

More Books

Students also viewed these Databases questions