Question: Design and implement the class Day that implements the day of the week in a program. The class Dayshould store the day, such as Sun

Design and implement the class Day that implements the day of the week in a program. The class Dayshould store the day, such as Sun for Sunday. The program should be able to perform the following operations on an object of type Day

Set the day-setDay()- a void method that takes the day as a parameter

Print the day-printDay()- a void method that prints the day and has no parameters

Return the day giveDay()-returns day which takes no parameters

Return the next day-giveNextDay()- returns next day which takes no parameters

Return the previous day-givePreviousDay()-returns previous day which takes no parameters

Write a program call it HW4.java to test various operations on the class Day

Follow coding standards carefully.

Remember to comment

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!