Tags:
tag this topic
create new tag
view all tags
---+ Seventh lab: Calendar: Part 3 ---++ Learning Objective(s) 1. Learn to work with text files 1. Learn to use exceptions 1. 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 <b>CalendarKeeper</b> * 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. <pre> 3.5 write code </pre> <br><br> ---++Partial sample dialogue <pre> Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 1 What year, month, and day associated with your task? 2022 5 15 What is the task? code How many hours do you think it will take? 3 Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 1 What year, month, and day associated with your task? 2022 5 15 What is the task? study How many hours do you think it will take? 2.5 Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 1 What year, month, and day associated with your task? 2022 4 21 What is the task? relax How many hours do you think it will take? 1.5 Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 2 What year, month, and day associated with your task? 2022 5 15 The tasks for that day are: 3.0 code 2.5 study Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 3 What year, month, and day associated with your task? 2022 5 15 The total number of hours for that day are 5.5. Which do you want to do? 1) add a task to a day 2) display everything assigned to a day 3) display the number of hours assigned to a day 4) display the number of hours assigned to a month 0) quit 0 </pre> ---++ Submission 1 Create an empty zip folder. 1 Place your program (.java file) in it 1 Place your software development report in it. 1 Submit the zip folder on canvas ---++ Optional improvements none this time
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r4
<
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Ra
w
edit
|
M
ore topic actions
Topic revision: r4 - 2022-03-15
-
cathybareiss
Home
Site map
Assessment web
BethelAIResources2026 web
CenterForComputing web
ChatGPT web
Intro2AIatBethel web
Main web
Sandbox web
TWiki web
CenterForComputing Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
View
Raw View
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Register User
E
dit
A
ttach
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback