Your main function will still prompt the user

Assignment Help C/C++ Programming
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.

Reference no: EM13166246

Questions Cloud

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.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write function that randomly produces maze

Write a function mazeGenerator that randomly produces a maze (in C++). The Function should take as arguments a two-dimensional 12-by-12 character array.

  Design customized mailing lists for marketing department

Marketing department requires to be able to design customized mailing lists, to send different messages to different types of donors. What system will best meet these requirements?

  Calculate the total of a purchase from a farmer''s market

You will develop a program that can calculate the total of a purchase from a farmer's market that sells apples, bananas, and oranges. At this particular market, apples are $1.99/lb., bananas are $0.99/lb., and oranges are $1.50/lb. Users should be..

  Write program to count occurrences of each word in text

Write down C++ program to read following text. Count occurrences of each word in text and keep this count in list of elements containing (word, occurrence count) pairs.

  Add a sentinel command to stop the loop

add a sentinel command to stop the loop. When the program is compiled, It'll ask the user to type in a palindrome. I want the user to type EXIT to end the loop.

  Write a program that allows users to enter a dollar amount

Write a program that allows users to enter a dollar amount for their bank account balance at the beginning of the month.

  Write c program which has parent process and child process

Write a C program that has a parent process, a child process, and a grandchild process. The parent process should print its id and the square or 5.

  Prepare a program that uses the pthread library

Prepare a C/C++ program that uses the PTHREAD library to create threads and mutexes to synchronize them.

  C++ pointer function synopsis

C++ pointer Function Synopsis: char *amonthLess(char *dateString) Description: Variable dataString is a valid date in a form of mm/dd/yyyy Given the above information, write a main() program that asks a user to enter a date in a form of mm/dd/yyyy..

  Write program function prompt user for number of elements

Write a C++ program main function which will prompt the user for the number of elements called N desired for an array which has the capacity to store 50 elements.

  Programs written with inheritance

Many programs written with inheritance could be written with composition instead, and vice versa. Rewrite the classes Point3D, Sphere and Cylinder using composition rather than inheritance

  Print each employee''s identification number

1) in a program you need to store the identification numbers of 10 employees (as ints) and their weekly gross pay (as doubles) A) Define two arrays that may be used in parallel to store the 10 employee indentificcation numbers and gross pay amounts B..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd