-Create two clockType objects: cellPhoneClock and myComputerClock.
-Prompt the user to enter the times for both clocks.
-Display both times with appropriate documentation.
-If the clocks do not have equal times, set myComputerClock to the cellPhoneClock time.
-Set myComputerClock so that it is 1 hour, 5 minutes, 23 seconds faster than the cellPhoneClock.
-Display both times again, with appropriate documentation.
I am needing help starting with the step where it says that if the clocks arent equal to set them equal to each other.
testclockType.cpp file
#include <iostream>
#include<string>
#include "clockType.h"
using namespace std;
int main()
{
//Variables for cell phone clock
int phrs;
int pmins;
int psecs;
//Variables for computer clock
int chrs;
int cmins;
int csecs;
cout << " Welcome! \n" ;
cout << " Set your clock \n" ;
testclockType.cpp: In function âint main()â:
testclockType.cpp:80: error: no match for âoperator<<â in âstd::operator<< [with _Traits = std::char_traits<char>](((std::basic_ostream<char, std::char_traits<char> >&)(& std::cout)), ((constchar*)"Cell Phone : ")) << cellPhoneClock.clockType::printTime()â
It's where I try to display the cell phone time. Not sure why it is not working
1 2 3 4 5 6 7 8 9 10 11
if (phrs != chrs && pmins != cmins && psecs != csecs)
{
myComputerClock.equalTime(cellPhoneClock);
cout << "The original time was : \n";
cout << "Cell Phone : " << cellPhoneClock.printTime();
/*cout << endl << endl;
cout << "Computer : " << myComputerClock.printTime();
cout << endl << endl;
cout << "The time now is : \n";
//cout << "Cellphone : " << cellPhoneClock.equalTime();*/
}
It worked! Thank you.
But now I am receiving these errors:
1 2 3
testclockType.cpp: In function âint main()â:
testclockType.cpp:88: error: no matching function for call to âclockType::equalTime()â
clockType.h:36: note: candidates are: bool clockType::equalTime(const clockType&) const