I am continually looking over my notes and book trying to figure this out but i cant seem to find what i need.

the project is to compile a automated speeding ticket

[Note: Checkpoint A and B are always 5 miles apart]

Ticket prices are calculated as follow: base + fee*<number of mph over the speed limit>. The base is $150 and the fee per mph over the speed limit is $5. Time is kept in the number of minutes past midnight, so 10AM is 10hours * 60 minutes = 600, 10:30AM = 630, 10PM = 60(12+10) = 1320. Speed should be truncated, so a car moving 4.341 will be calculated at 4mph.

program should accept these inputs:

License plate number

Time at Checkpoint A (in minutes)

Time at Checkpoint B (in minutes)

Speed limit in time zone

currently all i really have is the basic in and out commands, and i believe the formula for the checkpoints. can anyone with some time please look over my program and help me get started in the right direction? I cant seem to get the if else if statement to work.

for example if input the following

CheckpointA: 1230

CheckpointB: 1237

Speed Limit: 55

it should report that no ticket is issued... however my program continues to give a ticket

Code:#include <iostream> #include <iomanip> #include <string> using namespace std; int main() { string license; double base = 150, fee = 5, ticket; int mph, timeA, timeB; cout << "Enter license plate number" << endl; cin >> license; cout << "Enter time at Checkpoint A" << endl; cin >> timeA; cout << "Enter time at Checkpoint B" << endl; cin >> timeB; cout << "Enter speed limit in the zone" << endl; cin >> mph; if(mph < (timeB - timeA)*12) { ticket = base + fee * ((timeB-timeA)*12- mph); cout << "A ticket of $" << ticket << " is issued to " << license << endl; } else cout << "No ticket issued" << endl; return 0; }