time

I am trying to do an assignment for my c++ class. this is what the code should do....
This program will as the user to enter the time he/she arrived at the C++ Parking Garage.the user inputs the arrival and departure time. The program will check that the times are valid and calculates the amount owed for parking. The parking rate is $2.00 for each 30 minutes.
I am having trouble figuring this out. I don't know where to even start. Here is what I have so far
#include <cstdlib>
#include <iostream>
#include <ctime>
#include <iomanip>
#include <cmath>

using namespace std;

int main()
{
string anotherTicket;
int arrivalTime=0;
int departureTime=0;
int totalTime=0;
float amountDue=0.00;

cout<< "This program will as the user to enter the time he/she arrived at the C++ Parking Garage."
"\nThe user inputs the arrival and departure time."
"\nThe program will check that the times are valid and calculates the amount owed for parking."
"\nThe parking rate is $2.00 for each 30 minutes."<<endl;

cout<< "Here at the C++ International Airport, we use the 24 hour clock." << endl;
cout<< "i.e., noon is 12:00 and 1 in the afternoon is 13:00."<<endl;

//get arrival time
cout<<"Please enter the time you arrived in HR:MIN format: "<<endl;
cin>>arrivalTime;
cout<<endl;

//get departure time
cout<<"Please enter the time you left the garage in HR:MIN format: "<<endl;
cin >>departureTime;
cout <<endl;

//calculate total time and amount due and display results
totalTime=departureTime-arrivalTime;
cout<< "You parked for ""Hours and ""Minutes" <<endl;

amountDue=(totalTime/30)*2.00;
cout<< "the amount due is: $ " <<endl;

while(anotherTicket=="no"){

cout<< "Do you want to enter another ticket? Enter yes or no: ";
cin>>anotherTicket;
break;
}

system("PAUSE");
return 0;
}
thanks for any help
So arrivalTime is an int, but you're telling people to enter the value in HR:MIN format?

12:34 sure is a funny looking integer.
Topic archived. No new replies allowed.