Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in java . . . . - Declare three integer variables, all initialized to 0, and respectively named dayOfTheWeek, dayOfTheMonth. and firstDayOfTheMonth. Remember to comment
in java
. . . . - Declare three integer variables, all initialized to 0, and respectively named dayOfTheWeek, dayOfTheMonth. and firstDayOfTheMonth. Remember to comment each based on its role (see below for details). 3 points Declare & initialize a Scanner variable named s. 1 point Display the following message on the screen "Please enter an integer representing the date in the current month: 1 point Read an int value from the user and store it in variable dayOfTheMonth. 1 point Decrement dayOfTheMonth by 1 to represent the fact that our formula will assume that we numbers days in a month starting at O instead of 1. 1 point Display the following message on the screen "What was the first day of the month? Enter O for Monday, 1 for Tuesday.... 1 point Read an int value from the user and store it in variable firstDayOfTheMonth. 1 point Increment dayOfTheMonth by firstDayOfTheMonth. 1 point Store in the variable dayOfTheWeek the result of computing the modulo of the contents of dayOfTheMonth by 7.1 point Display the following message on the screen "Today is". Make sure that the next information that will be displayed will be on the same line. 1 point Perform the following conditional actions: 3 points . Test if dayOfTheWeek is 0. if it is, display "Monday". Test if dayOfTheWeek is 1. if it is, display "Tuesday". Test if dayOfTheWeek is 2, if it is, display "Wednesday". Test if dayOfTheWeek is 3, if it is, display "Thursday". Test if dayOfTheWeek is 4. if it is, display "Friday". Test if dayOfTheWeek is 5, if it is, display "Saturday" Test if dayOfTheWeek is 6, if it is, display "Sunday: . 0 Dlearn Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started