Question: Java with if else statements and loops if needed Due date: Today, at the end of the lab period Read this entire document before beginning
Due date: Today, at the end of the lab period Read this entire document before beginning your lab. The Comp248LabManual is available on the course's Moodle website. For this lab you are required to fulfill all requirements exactly as described in this provided document, no less, no more. Question: Today you are commissioned to write a Java program that will prompt for and read 2 integer values as year and month that are entered by the user and determine the number of days in that month. Be sure to use the same format and wording as in the sample runs in the table below. Using nested its determine the number of days in that month. If the month is one of 1,3,5,7,8, 10, or 12, the month has 31 days; If the month is one of 4, 6, 9, and 11, the month has 30 days: If the month is 2, the month has 29 days in a leap year, and 28 days in a non-leap year. If the year is divisible by 100 and 400, the year is a leap years of the year is not divisible by 100, whether the year is a leap year is further determined by whether the year is divisible by 4: If the year is divisible by 4, it is a leap year, otherwise it is a non-leap year. The box below illustrates how your program should behave and appear. REMEMBER in the output: is a Space and is a new line. Text in green is user input Enter year and nonth:-2000-2 Enter year and month: 2021-24 There are 29 days in that month! There are 28 days in that month! Enter year and month: 20213 Enter year and month: 202192 There are 31 days in that month There are 30 days in that nonth! Enter year and nonth: 202110 There are 31 days in that month! Note 1: You are to expect a perfect user who will always enter 2 positive integers; that is, do not verify the validity of user input Note 2: The use of libraries other than java.util.Scanner is prohibited. Your program must work for any positive Integers entered, not just the ones in the samples above. Note 3: Final thought, remember that your solution is case-sensitive and space-sensitive and fulfill the above instructions carefully and precisely Reminder: When submitting your solution to the lab system, make sure that if you have a package statement at the top of your java file it is commented out (has // in front of it) as failing to do so will result in a grade of (restriction of the DOM udge system)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
