Hi everyone! So I am really new to C++ and am currently taking this computer science class in school. We use Visual Stuio 2013. Tomorrow I have 3 programs due and I have only finished 1 so far. Everything I read in my textbook and what the teacher says confuses me.

The program I am currently working on is a MPH to Pace (minutes & seconds per mile) converter. here's what I have so far:

#include <iostream>
using namespace std;

int main()
{
    double P;
    double minute;
    double second;
    double MPH;

    cout << "What is your speed in Miles Per Hour? \n";
    cin >> MPH;

    P = 60.0 / MPH;
    second = (P - int) * 60;
    minute = P - second;

    cout << "Your pace for \n";
    cout << MPH;
    cout << "is \n";
    cout << minute;
    cout << "minutes \n";
    cout << second;
    cout << "seconds per mile. \n";

    cout << " \n";
    cout << "Testing 1, 2, 3\n";
    getchar();
    return 0;
}

So far I keep getting the "error C2059: syntax error : ')' ". I know a good chunk if not all of this is wrong. Any suggestions on what do do/fix?
Thanks! :)

second = (P - int) * 60;

This makes no sense. What are you trying to subtract from the value P?

Edited 1 Year Ago by Moschops

This question has already been answered. Start a new discussion instead.