in your reply
"You want to make a new Day and leave the old day as it is.
So calculate the new day number and get a new Day instance with "Day nextDay = new Day(newDayNumbe r)". Then you can use the printDay() method of this new day instance."
i cant understand it, where should i apply that one
and i change the codes under the methods next and previous days yet the answer is not correct...
User Profile
Collapse
-
skykier replied to Design and implement the class Day that implements the day ofthe week in a program.in Javain your reply
"You want to make a new Day and leave the old day as it is.
So calculate the new day number and get a new Day instance with "Day nextDay = new Day(newDayNumbe r)". Then you can use the printDay() method of this new day instance."
i cant understand it, where should i apply that one
and i change the codes under the methods next and previous days yet the answer is not correct...Leave a comment:
-
skykier started a topic Design and implement the class Day that implements the day ofthe week in a program.in JavaDesign and implement the class Day that implements the day ofthe week in a program.
Design and implement the class Day that implements the day ofthe week in a program. The class Day should store the day,such as Sun for Sunday. The program should be able to performthe following operations on the object of type Day:
a. set the day
b. print the day
c.return the day
d.return the next day
e. return the previous day
f. calculate and return the day by adding certain days to the current day.....Last edited by Rabbit; Apr 10 '14, 03:12 PM. Reason: Please use [code] and [/code] tags when posting code or formatted data.
No activity results to display
Show More
Leave a comment: