IsaacjWeek4 - BaseTime class: using System; using...

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

View Full Document Right Arrow Icon
BaseTime class: using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace isaacJweek4 { class BaseTime { //attributes public int hour; public int minute; public int incrementhour; public int incrementminute; //constructor public BaseTime() { hour = 12; minute = 0; incrementhour = 0; incrementminute = 0; } public BaseTime( int hour, int minute, int incrementhour, int incrementminute) { this .hour = hour; this .minute = minute; this .incrementhour = incrementhour; this .incrementminute = incrementminute; } // behaviour public virtual int incrementHour( int hour) { hour = (hour + incrementhour) % 24; return hour; } public virtual int incrementMinute( int minute) { minute = (minute + incrementminute) % 60; if (minute <= 0) { Console .WriteLine( "Please enter a time that can be calculated" ); } return minute; } // Properties public int Hour {
Background image of page 1

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

View Full DocumentRight Arrow Icon
get { return hour; } set { hour = value ; } } public int Minute { get { return minute; } set { minute = value ;
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.

Page1 / 5

IsaacjWeek4 - BaseTime class: using System; using...

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