Tags:
view all tags
---+ Methods: Calendar ---++ Learning Objective(s) 1 Reinforce repetition 1 Learn to use methods 1 Learn to manipulate strings ---++ Overview of the Program Time for something new. You are to write a program that outputs a calendar (similar to what is seen in the sample output) The user inputs a calendar year and the day of the week that Jan. 1st falls on (between 0 and 6). Your program then outputs the calendar. ---++ Details 1. Write a method <b>monthName</b> that is sent a number (between 1 and 12) and returns a string that contains the name of the month (such as April) 1. Write a method <b>daysInMonth</b> that is sent a month (numbers between 1 and 12) and a year and returns the number of days in that month. One of the hints has specific data to help. 1. Write a method <b>displayMonth</b> that is sent a month, year, and a third integer (between 0 and 6 that states the first day of the month). This method outputs the calendar of that month. 1. Use those methods to display the entire calendar of the year (see the hints about program design for more details) ---++ Example program dialogue: <pre> Year: 2023 First day: 0 January Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 February Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 March Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 April Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 May Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 June Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 July Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 August Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 September Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 October Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 November Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 December Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 </pre> ---++ Submission a. create an empty zip folder a. place your java file into it a. create a pdf document that contains your Software Development Report for this program and place the pdf file into the zip folder a. submit the zip folder on canvas ---++ Hints 1. [[CSC121S2023Lab6H1][Program design]] 1. [[CSC121S2023Lab6H3][Help with the name of the month]] 1. [[CSC121S2023Lab6H2][Help with days of the month]] 1. [[CSC121S2023Lab6H4][Help with displaying a month]] ---++ Optional improvements Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor. You must score at least 90% on the rest of the program to earn any additional points * Do not require the user to input the day of the week that Jan. 1st falls on. Compute it instead.
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r3
<
r2
<
r1
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r2 - 2023-02-06
-
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
Edit
Attach
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