week_6_lab - #include using namespace std; class...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 #include <iostream> using namespace std class Time { public: void setHour(int) void getMinute (int) int getHour() int getMinute() void printTime () Time () Time (int, int) private: int hour int minute } Time::Time() //default constructor sets the hour and minute to 0 { hour = 0 minute = 0 } Time::Time (int hr, int min) { hr = hour min = minute } void Time::setHour (int hr) { hr = hour } void Time::setMinute (int min) { min = minute else minute = 0 } int Time::getHour() { return hour } int Time::getMinute()
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Page 2 { return minute } void Time::printTime() { cout<<getHour()<<":"<<getMinute() } //Set Class date class date { public: void setMonth(int) void setDay(int) void setYear(int) int getMonth() int getDay() int getYear() void printDate() Date() Date (int, int, int) private: int month int day int year } Date::Date() { month = 1 day = 01 year = 2000 } Date::Date (int num, int dd, int yyy) { mmm = month dd = day yyy = year
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 01/30/2011 for the course BUS 247 taught by Professor Long during the Winter '10 term at DeVry Long Beach.

Page1 / 8

week_6_lab - #include using namespace std; class...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online