No, im not asking anyone to do my work for me before you ask! I have been asked to:
So far I have the basic system in place, I am able to input a date, which will be written to an int, and then I return the inputed values.
Reading this, I do not see that I have to create an entire calendar (Nor do I know how!) However I was just wondering if you would say the same, and wheter or not people think it would be ok to import a Calendar class for use in my program, to corectly return dates, allow me to add and subtract days/months/years etc.
If yes, does anyone know where I would find Calendar.Java as my searches simply return descriptions about the class, but not the actual Calendar.Java class...
Thanks
Code:
This part of the assignment is based on writing and testing a small class to
represent dates.
Your report should contain an annotated copy of the source code, along
with description of the steps that you used to test your program.
• Write a class declaration for Date, representing a Date as day, month,
and year. Use appropriate access control.
• Write a method void set(int d, int m, int y) which sets a Date
to a particular value.
• Write a member function called output which displays the value of a
Date in suitable form.
• Write member functions to add and subtract years and months from a
Date
• Write member functions tomorrow() and yesterday() that add or
subtract one day from a Date. Take care to handle the beginning and
end of months and years correctly.
• Write a member function that converts a Date into the number of days
before/after the first of January 1900. Use this function to calculate
your age in days.
Note that your marks for this section will also depend on the quality
of your code, in terms of comments, layout, naming conventions, and other
stylistic points.
So far I have the basic system in place, I am able to input a date, which will be written to an int, and then I return the inputed values.
Reading this, I do not see that I have to create an entire calendar (Nor do I know how!) However I was just wondering if you would say the same, and wheter or not people think it would be ok to import a Calendar class for use in my program, to corectly return dates, allow me to add and subtract days/months/years etc.
If yes, does anyone know where I would find Calendar.Java as my searches simply return descriptions about the class, but not the actual Calendar.Java class...
Thanks

Last edited: