Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java Chapter 3, Problem 11PE import java. util. scanner: public class MonthDays f public static void main (Stri //create object for scanner Bcanner input

image text in transcribed

in java

Chapter 3, Problem 11PE import java. util. scanner: public class MonthDays f public static void main (Stri //create object for scanner Bcanner input new scanner C //Getting month system. out.print ("Enter a to int month input. nextInt 02 int days 0: //Getting year system. out.print ("Enter a ye int year input.nextInt 0 //Pinding the leap year Programming Exercise 3.11 (Find the number of days in a month) Write For example, a program that prompts the user to enter the month and year and displays the number of days in the month. If the user entered month 2 and year 2012, the program should display that February 2812 has 29 days If the user ontered month 3 and year 2015, the program should display that March 2015 has 31 days boolean isleaprear (year % 4 0)II (year 400 0) SAMPLE RUN1: //Finding month days switch (month) Enter a month in the year (e.g., 1 for Jan): 2 Enter a year: 2012 February 2012 has 29 days SAMPLE RUN 2: Enter a month in the year (e.g., 1 for Jan): 4 Enter a year: 2085 April 2005 has 30 days case 1: days 31:break : case 2: if (isLeapYear) days case 3: days 31:break: case 5: days 31:break: case 6: days 30:break: case 7: days 31ibreaki case 8: days 31:break; case 9: days 30; break case 10:days 31:breakr case 11:days 30:break: case 12:days 31:break: SAMPLE RUN 3: Enter a month in the year (e.g, 1 for Jan): 2 Enter a year: 2006 February 2006 has 28 days SAMPLE RUN 4: Enter ia //Display output system. out.println (nonth+ 2016 a year: 2000 February 2000 has 29 days Comment

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Database Modeling With Neo4j

Authors: Ajit Singh

2nd Edition

B0BDWT2XLR, 979-8351798783

More Books

Students also viewed these Databases questions

Question

help asp

Answered: 1 week ago