Exercise P18.4. Define output operators for Clock and TravelClock. Modify the cl
ID: 3537138 • Letter: E
Question
Exercise P18.4. Define output operators for Clock and TravelClock. Modify the classes Clock and TravelClock to declare the output operators as friends.
Hi guys, here's the problem that I'm having with this program. I'm receiving error messages stating that "cannot open source file "ccc_time.h" and "travelclock.h". What i'm I missing here?
------ Build started: Project: ModifiedClock, Configuration: Debug Win32 ------
Build started 6/2/2013 1:34:30 PM.
InitializeBuildStatus:
Touching "DebugModifiedClock.unsuccessfulbuild".
ClCompile:
travelclock.cpp
c:usersjasondocumentsisual studio 2010projectsmodifiedclockmodifiedclock ravelclock.cpp(4): fatal error C1083: Cannot open include file: 'travelclock.h': No such file or directory
clock.cpp
c:usersjasondocumentsisual studio 2010projectsmodifiedclockmodifiedclockclock.cpp(1): fatal error C1083: Cannot open include file: 'ccc_time.h': No such file or directory
ccc_time.cpp
c:usersjasondocumentsisual studio 2010projectsmodifiedclockmodifiedclockccc_time.cpp(6): fatal error C1083: Cannot open include file: 'ccc_time.h': No such file or directory
Generating Code...
Build FAILED.
Time Elapsed 00:00:03.23
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
#include
using namespace std;
class Clock
{
public:
// this code added to overload the output operator
friend ostream& operator<< (ostream &out, Clock &cClock);
Clock(bool use_military);
string get_location() const;
int get_hours() const;
int get_minutes() const;
bool is_military() const;
private:
bool military;
};
============================================================================
#include
#include
using namespace std;
#include "clock.h"
class TravelClock : public Clock
{
public:
// this code added to overload the output operator
friend ostream& operator<< (ostream &out, TravelClock &cClock);
TravelClock(bool mil, string loc, int diff);
string get_location() const;
int get_hours() const;
private:
string location;
int time_difference;
};
Explanation / Answer
This is a huge program and not worth 750 :
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.