i already did not turn in this lab but it is killing me. tell me why I am getting so many errors....
//This is the most confusing program in the world. I was not trained
//correctly for this. But as long as the proffesor gives me the code
//i can do it. a wast of time.
#include <iostream>
#include <stdio.h>
using namespace std;
//defining rates i do not know when to ad double??
//prototyp declaration: getInfo, time, rate, charge, print
void getInfo (char *vehicle, int *hourIn, int *minIn,
int *hourOut, int *minOut);
void time (int *hourIn, int *hourOut, int *minIn, int *minOut,
int *hourParkTime, int *minParkTime, int *roundedTotal,
int *round);
void rate (int vehicle, int *units, float *firstRate, float *secondRate);
void charge (int roundedTotal, int units, float firstRate,
float secondRate, float *totalCharge);
void print (char vehicle, int hourIn, int minIn, int hourOut, int minOut,
int hourParkTime, int minParkTime, int roundedTotal,
float totalCharge);
//global definitions//
char vehicle;
int units;
int hourIn;
int minIn;
int hourOut;
int minOut;
int hourParkTime;
int minParkTime;
int roundedTotal;
int round;
float firstRate;
float secondRate;
float totalCharge;
const double firstCarRate = 0.00;
const double secondCarRate = 1.25;
const double firstBusRate = 2.00;
const double secondBusRate = 2.50;
const double firstTruckRate = 3.75;
int main()
{
void getInfo (char &vehicle, int &hourIn, int &minIn,
int &hourOut, int &minOut);
void time (int hourIn, int hourOut, int minIn, int minOut,
int &hourParkTime, int &minParkTime, int &roundedTotal,
int &round);
void rate (int vehicle, int &units, float &firstRate, float &secondRate);
void charge (int roundedTotal, int units, float firstRate,
float secondRate, float &totalCharge);
void print (char vehicle, int hourIn, int minIn, int hourOut, int minOut,
int hourParkTime, int minParkTime, int roundedTotal,
float totalCharge);
return 0;
}
//Validate user input
if (minIn <= 0)
cout << minIn << "\n\a is not a invalid time.\n";
cout << "Run the program again and enter a time in the range\n";
cout << "00.00 to 23.59\n";
if (minOut > 23.59)
cout << "\n\a**Please adjust time there is no over night parking. **\n";
//getInfo
void getInfo (char *vehicle, int *hourIn, int *minIn,
int *hourOut, int *minOut)
//statements
cout << "Type of vehicle? ";
cin >> *vehicle;
cout << "Hour vehicle entered lot ";
cin >> *hourIn;
cout << "Minute vehicle entered lot ";
cin >> *minIn;
cout << "Hour vehicle left lot ";
cin >> *hourOut;
cout << "Minute vehicle left lot ";
cin >> *minOut;
return;
//time
void time(int hourIn, int hourOut, int minin, int minout, int
*hourParktime, intminParktime, int*roundedTotal,int *round,
int *hourParkTime, int*minParkTime, int*roundedTotal, int*round
if (minOut < minIn)
{
minOut = minOut + 60
hourOut = hourOut;
}
else
*hourParkTime = hourOut - hourIn;
*minParkTime = minOut - minIn;
if (*minParkTime >= 1)
{
*rounded = *hourParkTime+1;
*roundedTotal = *round;
}
else
{
*round = *hourParkTime;
*roundedTotal = *round;
}
//rate
void rate(char vehicle, int * units, float *firstRate, float *secondRate)
switch (vehicle)
{
case 'c':
case 'C': * units = 3;
*firstRate = firstCarRate;
*secondRate = secondCarRate;
break;
case 't':
case 'T':* units = 2;
*firstRate = firstTruckRate;
*secondRate = secondTruckRate;
break;
case 'b':
case 'B': *units = 1;
*firstRate = firstBusRate;
*secondRate = secondBusRate;
break;
default: cout << "You did not enter T, B, or C!\n";
return;
}
//charge
void charge (int roundedTotal, int units, float firstRate, float secondRate,
float *totalCharge)
{
if (roundedTotal <= units)
*totalCharges = roundedTotal * firstRate
else
*totalCharges = (units * firstRate) + (roundedTotal * secondRate);
return;
}
//print bill
void print (char vehicle, int hourIn, int mainIn, int hourOut,
int minOut, int hourParkTime, int minParkTime,
int roundedTotal, float totalCharge)
{
printf("\nPARKING LOT CHARGE\n\n");
printf("\nType of vehicle\n", vehicle);
printf("\nTIME IN: %d:%d\n", hourIn, minIn);
printf("\nTIME OUT: %d:%d\n", hourOut, minOut);
printf("\n---------------\n");
printf("\nParking Time: %d:%d\n", hourParkTime, minParkTime);
printf("\nRounded Total: %d\n", roundedTotal);
printf("\n---------------\n");
printf("TOTAL CHARGE: %d\n", totalCharge);
return;
}
return 0;
}