Sunday, July 12, 2009

Write a C++ program that will calculate monthly bills for customers of an internet service provider..?

This assignment requires you to write a C++ program that will calculate monthly bills for customers of an internet service provider..The name of the input file is P3_data.txt; each line in the file contains the following information for one customer


first_name last_name type_of_service number_of_hours


Data items are separated by blanks.


There are three types of service: A,B,C.


Charges are determined as follows:


package A 9.95 for 15 hours monthly. additional hours are $2.00 per hour


package B 14.95 for 30 hours monthly additional hours are $1.00 per hour


package C 39.95 for unlimited hours


this is P3_data. txt


Herman Hacker C 300


Horatio Hacker A 73


Mort Measle A 8


Mac Jones A 18


Janice Lemon A 17


Alice Cooper C 700


Matt Miyagi C 744


Kandace FreemanC 10


Zac Zachary B 22


Barb Benson B 56


Hillary Hacker B 32


Hortense Hacker B 91


OneMore Hacker C 780


Anu Hacker A 12


Yappy Yodeler X 32


Sven Stephens A 15


Frank Fink C 17


Frank FinkII A 17

Write a C++ program that will calculate monthly bills for customers of an internet service provider..?
Are you expecting us to write the whole program for you or do you have a specific question?





Basically, your program will do the following:





Open the file using an ifstream object


Make a loop, reading each line of the file until the file is empty


In that line, break up each first/last/package/hours by the space ' ' that is between each


Make a switch/case statement on the package


Depending on the package, calculate the amount they are owed and print it out / write it to a file.

yu gi oh cards

No comments:

Post a Comment