The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 407 Weeks Ago, 6 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
The Little Parking Garage
A parking garage has 5 customers daily. The garage charges a $5.00 minimum fee to park up to two hours. The garage charges an additional $1.00 per hour for each hour (or part of an hour) over two hours. The maximum charge for any given day is $12.00. All cars are gone by midnight. Write a program to calculate and print a summary of the charges for a day. For input the program will read the hours of usage for each of the 5 cars. The program will print the results in the form of a table in a neat format, as shown below.
Enter the hours parked for car 1: 1.5
Enter the hours parked for car 2: 4.1
Enter the hours parked for car 3: 12.0
Enter the hours parked for car 4: 9.3
Enter the hours parked for car 5: 0.5
Total Hours 27.4Â Â Â Â Â Â Â
Total Charge $42.00
Use one decimal place for the hours parked, and 2 for the total charge. Name this program ParkingGarage.cpp
NOTE: The program standards are given below:
1. Program Header .  In addition to you name and project number, include a brief description of the program functionality in the header comment for the program
2. Variables and Constants.   All variables and constants in a program must be declared at the beginning of the program
3. Initialization.  Variables may not be initialized in their declaration.
4. Printing of if-then.  Use one of the following
    if (expression) statement
    if (expression)
       Single-statement
    if (expression) {
       Multiple-statements
    }
5. Printing of if-then-else. Use one of the following
    if (expression) statement
    else           statement
    if (expression)
       Single-statement
    else
       Single-statement
    if (expression) {
       Multiple-statements
    } else {
       Multiple-statements
          }
6. Printing of while loops.  Use one of the following
    while (expression) statement
    while (expression)
       Single-statement
    while (expression) {
       Multiple-statements
    }
7. For loops.  The bodies of all for-loops must be indented at least 3 (but no more than 5) spaces:
   for(int i = 0; i < n; i++) {
      cout << "Enter the number:" << flush;
      cin >> num;
      if (num < 0)     num_neg++;
      else if (num > 0) num_pos++;
      else             num_zero++;
   }
8. Methods.  The bodies of all functions must be indented at least 3 (but no more than 5) spaces:
double CircleArea(double r) {
        const double Pi = 3.1415;
         return Pi * r * r;
    }
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on-----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be-----------