In the method named: nextDay, the method should increment the current day to the next day. You will need to make sure that it will increment to the next month or next year if needed. For example, if the current date is 7/31/2015, the method should increment the date to: 8/1/2015 (since 7/32/2015 is an impossible date). Likewise, if the date is 12/31/2015, the method should increment the date to 1/1/2016.
In the method named: previousDay, the method should decrement the current day to the previous day. You will need to make sure that it will decrement to the previous month or previous year if needed. For example, if the current date is 8/1/2015, the method should decrement the date to: 7/31/2015 (since 8/0/2015 is an impossible date). Likewise, if the date is 1/1/2016, the method should decrement the date to 12/31/2015.
In the method named: nextMonth, the method should increment the current month to the next month. You will need to make sure that it will increment to the next year if needed. For example, if the current date is 12/31/2015, the method should increment the date to: 1/31/2016 (since 13/31/2015 is an impossible date). Consider this, what should happen if the date is the following: 1/29/2013, as there is no such date: 2/29/2013? (I'm leaving this up to you to decide how to handle this impossible date since the year 2013 was not a leap year).
In the method named: previousMonth, the method should decrement the current month to the previous month. You will need to make sure that it will decrement to the previous year if needed. For example, if the current date is 1/31/2016, the method should decrement the date to: 12/31/2015 (since 0/31/2016 is an impossible date). Consider the leap year issue again, what should happen if the date is the following: 3/29/2013, as there is no such date: 2/29/2013? (I'm leaving this up to you to decide how to handle this impossible date since the year 2013 was not a leap year).
In the method named: nextYear, the method should increment the current year to the next year. This should be relatively straightforward since there are no special considerations that need to be made when incrementing the year to the next year.
In the method named: previousYear, the method should decrement the current year to the previous year. Consider this, what should happen if the date is the following: 2/29/2000, as there is no such date: 2/29/1999? (I'm leaving this up to you to decide how to handle this impossible date since the year 1999 was not a leap year).
Do not turn in this assignment BEFORE 11/12/15, as I will be discussing more on unit testing in class on 11/12/15 and adding a unit test class to this assignment for you to check your work!
Assignment is due 11/25/15 (Wednesday before Thanksgiving) by email, working source code and 3-4 sentence write up must be emailed for up to 40 points.
b) Method fahrenheit returns the Fahrenheit equivalent of a Celsius temperature, using the calculation fahrenheit = 9.0 / 5.0 * celsius + 32;
c) Use the methods from parts ( a) and ( b) to write an application that enables the user either to enter a Fahrenheit temperature and display the Celsius equivalent or to enter a Celsius temperature and display the Fahrenheit equivalent. Make sure to include a write up summary about what you learned from the assignment. Due: 10/01/15 at beginning of class, for a maximum of 40 points.
This assignment is due no later than the beginning of class on September 10, 2015, for a maximum of 40 points.
. . . . . . . . . ( end of section CSC 18A - Assignments) <<Contents | Index>>