Reference no: EM13166246
Write a complete C++ program that reworks your Cellular Bill calculation program from Chapter 4. Give your source file a meaningful name, such as CellBillFun.cpp.
Your new cell bill program must use 3 functions with parameters, as follows:
1. function calcRegBill - accepts one integer argument for the number of minutes used. Determines and returns the total amount due.
2. function calcPremBill - accepts two integer arguments, for the number of day minutes and number of night minutes used. Determines and returns the total amount due.
3. function printBill - accepts 4 arguments: a string account number, a character service code, an integer total number of minutes used, and an amount due. Note that this is a generic print bill function, which prints either a regular or premium bill, using the following format:
Account Number: XXXXXXX
Service Type: Regular (or Premium, depending on the character received)
Total Minutes: XXXX
Amount Due: $XXX.XX
Your main function will still prompt the user for the account number and service code. Based on the service code, main will ask for the correct number of minutes, then call your functions above as needed to finish the job. In addition you must :
- Correct any logic/calculation errors you had in your previous cellular bill program.
- Incorporate a loop in your program to run the bill as many times as needed. You may do this either by a sentinel controlled loop, or with a counter controlled loop.Make sure all of your control structures are properly indented.
- Run your program with the same test cases as the first Cellular Bill submission.
- Your output can be directed to the console window.
In all of your programs, you must remember the following:
- Include documentation at the beginning of your program.
- Include your first and last name as the first line of all of your program outputs.
- Use appropriate, meaningful identifier names for all variables in your program.
- Declare constant variables for any "numeric constants" in your code.
- Organize your code into logical sections that follow a general input, process, output structure.
Matlab program which will determine your vehicle fuel usage
: Create a MATLAB program which will determine your vehicle fuel usage (MPG, miles/gallon) rating for a user defined number of trips ('for' repetition structure). Review the voiceover supplied for an example of the required input/output from this progr..
|
Explain what is the root mean square speed
: If He(g) has an average kinetic energy of 4610 J/mol under certain conditions, what is the root mean square speed
|
Democratic-authoritarian-communist and capitalist
: What major governmental changes do you see occurring in Mexico, Brazil, and Argentina, for instance? Were they democratic, authoritarian, communist, capitalist?
|
State equation of state to calculate the pressure
: Use the van der Waals equation of state to calculate the pressure of 4.00 mol of NH3 at 455 K in a 5.90-L vessel.
|
Your main function will still prompt the user
: Your main function will still prompt the user for the account number and service code. Based on the service code, main will ask for the correct number of minutes, then call your functions above as needed to finish the job. In addition you must.
|
What is the mass of a cube of lead
: The mass of a cube of iron is 379 g. Iron has a density of 7.87 g/cm3. What is the mass of a cube of lead that has the same dimensions?
|
Find a number alpha mod 8745437489
: show that 7 is a primitive root mod 8745437489. Find a number alpha mod 8745437489 that is not a primitive root
|
Traditional brick and mortar education
: What is the difference between a traditional brick and mortar education and a distance education?
|
Calculate the amount of heat liberated
: Calculate the amount of heat liberated (in kJ) from 417 g of mercury when it cools from 64.0°C to 12.0°C.
|