// Car1 Info
cout << "Who is the driver for car one? ";
getline(cin, driver1);
cout << "What is the color for car one? ";
getline(cin, color1);
cout << "What is car one's number? ";
cin >> number1;
cout << "What was car one's laptime? "; // format M:S
cin >> laptimeM1 >> laptimeS1;
cin.ignore();
// Car2 Info
cout << endl << "Who is the driver for car two? ";
getline(cin, driver2);
cout << "What is the color for car two? ";
getline(cin, color2);
cout << "What is car two's number? ";
cin >> number2;
cout << "What was car two's laptime? ";
cin >> laptimeM2 >> laptimeS2;
cin.ignore();
// Car3 Info
cout << endl << "Who is the driver for car three? ";
getline(cin, driver3);
cout << "What is the color for car three? ";
getline(cin, color3);
cout << "What is car three's number? ";
cin >> number3;
cout << "what is car three's laptime? ";
cin >> laptimeM3 >> laptimeS3;
// convert all to seconds
int s1 = laptimeS1 + laptimeM1 * 60;
int s2 = laptimeS2 + laptimeM2 * 60;
int s3 = laptimeS3 + laptimeM3 * 60;
Where did you get this code? It is almost functional, except it is missing include statements, a using namespace std declaration, and the function main. There are literally 4 lines of code you could add to the top of this code and it would basically work.
1 2 3 4
#include <iostream>
#include <string>
usingnamespace std;
int main() {
Also, you have to put a space between the minutes and seconds when you enter lap time.