Ask your own question, for FREE!
Computer Science 22 Online
OpenStudy (anonymous):

please assist in trying to calculate words per minute in my code.

OpenStudy (anonymous):

int main() { time_t now = time(0); Time day_end(23, 59, 59); Time start; Time end; string sentence; cout <<" The current Time is:" << start.get_hours()<< ":" /* returns the seconds value of now */ << start.get_minutes() << ":" /* returns the minutes value of now */ << start.get_seconds(); /* returns the hours value of now */ cout << endl; cout << "Please type sentence:" << "The quick brown fox jumped over the lazy dog." << " " << "\n"; cin >> sentence; cout << endl; cout << "Ending Time after Senetence is Typed:"<< end.get_hours() << ":" /* returns the seconds value of now */ << end.get_minutes() << ":" /* returns the minutes value of now */ << end.get_seconds(); /* returns the hours value of now */ cout << endl; double whenfinished = start - end/9; cout <<"You Typed the following words perminute :"<< whenfinished; cout << endl; system("pause"); return 0; }

OpenStudy (anonymous):

the problem is I get this error "/" matches these operands

OpenStudy (anonymous):

when trying to make equation

OpenStudy (anonymous):

I think the issue is that you're trying to divide a Time object by 9. You can only do that if the operator has been overloaded in your Time class. Can you post the time code?

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!