Seventh lab: Calendar: Part 3
Learning Objective(s)
- Learn to work with text files
- Learn to use exceptions
- Improve ability to use methods
Overview of the program
This lab should track the number of hours scheduled to be done in a day.
Details
- The program should be called CalendarKeeper
- Activities include:
- Adding a task to a day (for a given date, the number of hours and the name of a task).
- Display all tasks associated with a given day
- Display the number of hours scheduled to that day
- Display the number of hours scheduled for a month
- File information
- Information about a given day should be stored in a file specified by the date (i.e. 2022_03_15) for March 15, 2022
- Each line starts with an integer specifying the numbers of hours and then a string specifying the task
- The program should allow tasks to be appended to a given file.
- Exception information
- All possible exceptions should be handled by your program.
- If the user specifies an invalid date, through an exception and catch it in the method that called it
- Method information
- Use one method to get the date from the user
- Use a separate method for each activity
- Input:
- When getting a date, ask for the year first, then the month, then the day. (All should be numbers)
- You must support the following for user input. You may supplement with other options.
- 0 (the number not letter) will be used to indicated no more work
- 1 will be used to indicate that a task is to be added
- 2 will be used to indicate that the user wishes to display the information about a day
- 3 will be used to indicate that the user wishes to see the number of hours assigned to a day
- 4 will be used to indicate that the user wishes to see the number of hours assigned to a month
- a line of input associated with a new task will look like the following. It indicates that the user plans to spend 3.5 hours on the task of writing code.
3.5 write code
Submission
- Create an empty zip folder.
- Place your program (.java file) in it
- Place your software development report in it.
- Submit the zip folder on canvas
Optional improvements
none this time
This topic: CenterForComputing
> WebHome >
SyllabiSpring2022 >
CSC121SylS2022 > CSC121S2022Lab7
Topic revision: r3 - 2022-03-01 - cathybareiss