So this program is supposed to take the users input
which is vehicle type and minutes parked
and display hours parked vehicle type and the fee for parking.
So the first problem I have is that how can I give a discount
of -2 or -1 hours with out going negative?
The next problem is how can I display the vehicle type from the
input?
and finally why is my program jumping to the end after the user
inputs vehicle type?
So this program is supposed to take the users input
which is vehicle type and minutes parked
and display hours parked vehicle type and the fee for parking.
So the first problem I have is that how can I give a discount
of -2 or -1 hours with out going negative?
The next problem is how can I display the vehicle type from the
input?
and finally why is my program jumping to the end after the user
inputs vehicle type?
<code> Program Name :
* Author :
* Date :
* Course/Section : CSC110-1001
* Program Description: This program will determine the total cost
* of parking for cars and trucks. It will do this by taking the
* amount of time each vehicle has been parked and multiply that
* by the the cost of parking and subtracting the discount of each
* vehicle
*
*
* BEGIN Lab 04 - Calculate the total for park
* Input vehicle type
* Input min parked
* Clear screen
* IF (invalid vehicle type)
* Display error;
* ELSE
* IF (vehicle is a car)
* vehicle make = car
* Divided Minutes by 60
Round number to next whole number
subtract 2 from whole number
Multiply rate by hours
* ELSE
* vehicle make = truck
* Divided Minutes by 60
Round number to next whole number
subtract 1 from whole number
Multiply rate by hours
* END IF
* Calculate hours parked
* Calculate fee
* Display Receipt
* END IF
* END Lab 04 - Calculate the total for park
**********************************************************************/
#include <cmath>
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
void main()
{
// local constants
const char CAR = 'C';
const char TRUCK = 'T';
const float RATE_C = 1.75;
const float RATE_T = 3.00;
const int DISCOUNT_C = 120;
const int DISCOUNT_T = 60;
// local variables
int Type; //First Number
float Min ;
float Park_Fee;
int Hours;
Well thank you for helping. The first problem is fixed.
the second one still not sure how to convert const char car = 'c' to display car
Also my if statement is not working right.
When it displays output The error message always displays.
Also it skips the if statment for car and just displays the results as if user put in truck?
<code>
void main()
{
// local constants
const char CAR ='C';
const char TRUCK = 'T';
const float RATE_C = 1.75;
const float RATE_T = 3.00;
const int DISCOUNT_C = 120;
const int DISCOUNT_T = 60;
// local variables
char Type; //Vehicale Type
float Min ; //Minutes Parked
float Park_Fee; //Fee to park
int Hours; //Hours Parked