import java.*; public class AClaycomb_IT145_FinalProg { //Variables int day; //Constant Values final int SUN = 0; final int MON = 1; final int TUE

import java.util.*;

public class AClaycomb_IT145_FinalProg

{

//Variables

int day;

//Constant Values

final int SUN = 0;

final int MON = 1;

final int TUE = 2;

final int WED = 3;

final int THU = 4;

final int FRI = 5;

final int SAT = 6;

//Step 1 Set the day

public void setDay(int day)

{

this.day = day;

}

//Step 2 Print the day

public void print()

{

System.out.println(this.toString());

}

//Step 3 Return the Day

public int getDay()

{

return day;

}

//Step 4 Calculation to get next day

public int nextDay()

{

int next = (day + 1) % 7;

return next;

}

//Step 5 Calculation to get previous day

public int previousDay()

{

int prev = (day – 2) % 7;

return prev;

}

//Step 6 Calculation to add days

public int addDays(int days)

{

int totalDays = (day + days + 1) % 7;

return totalDays;

}

//Constructors

public AClaycomb_IT145_FinalProg(int day) {

this.day = day;

}

//Override

public String toString()

{

switch (this.day)

{

case SUN: return “Sunday”;

case MON: return “Monday”;

case TUE: return “Tuesday”;

case WED: return “Wednesday”;

case THU: return “Thursday”;

case FRI: return “Friday”;

case SAT: return “Saturday”;

}

return “”;

}

}

 
"Looking for a Similar Assignment? Order now and Get 10% Discount! Use Code "Newclient"