Homework Solution: the user inputs a day it goes through the if statement…

    Assign5 (Protected View) Word kayla capp lings Review View Tell me what you want to do Unless you need to edit, its safer to stay in Protected View. Enable Editing Write an error-free Java program to do the following things. 1. Inputs the month (l for Jan, 2 for Feb, etc.), day of the month and the year. The program can ask the user for the month/day/year in any order. 2. The program should inform the user when a valid date has been entered. You may assume that the user will (correctly) enter integers but the inputs may be negative, too small or too big. If an invalid date has been entered, then print a brief message explaining the problem and the program terminates gracefully. For the purposes of this program you may assume that February has 28 days each year, even during leap years. (T know that this does not agree with the calendar, but it will simplify your program. Trust me on this.) 3. If the entered date is a valid date, the program informs the user whether the date is part of a new century. That is, the program prints a Welcome to the new Century any time the year is a multiple of 100 (1900, 2000, 2100, 2200 etc.). You can assume that the year will be greater than 1 but less than 3100 for this step. Sample output (2 separate computer runs): Input day: 3 »I | . | 1nput day: 31 Input month (1 - ut month (1= Jan, 2 Inp Feb, etc): 2 = Jan, 2 = Feb, etc): 8 Input year: Input year: 1900 Day too large. Please You have entered a correct. correct date. Welcome to the 20th century. Grading metric Program submitted: +2

    I need help writing an error free java program. I'm just not understanding how to even start it. how do I the and or statements so when the user inputs a day it goes through the if statements . I'm so confused. please use very simple java commands so I can understand.

    Assign5 (Protected View) Word kayla capp lings Review View Tell me what you want to do Unless you need to edit, it's safer to stay in Protected View. Enable Editing Write an error-free Java program to do the following things. 1. Inputs the month (l for Jan, 2 for Feb, etc.), day of the month and the year. The program can ask the user for the month/day/year in any order. 2. The program should inform the user when a valid date has been entered. You may assume that the user will (correctly) enter integers but the inputs may be negative, too small or too big. If an invalid date has been entered, then print a brief message explaining the problem and the program terminates gracefully. For the purposes of this program you may assume that February has 28 days each year, even during leap years. (T know that this does not agree with the calendar, but it will simplify your program. Trust me on this.) 3. If the entered date is a valid date, the program informs the user whether the date is part of a new century. That is, the program prints a "Welcome to the new Century" any time the year is a multiple of 100 (1900, 2000, 2100, 2200 etc.). You can assume that the year will be greater than 1 but less than 3100 for this step. Sample output (2 separate computer runs): Input day: 3 »I | . | 1nput day: 31 Input month (1 - ut month (1= Jan, 2 Inp Feb, etc): 2 = Jan, 2 = Feb, etc): 8 Input year: Input year: 1900 Day too large. Please You have entered a correct. correct date. Welcome to the 20th century. Grading metric Program submitted: +2

    Expert Answer

     
    calendar.java package calendar;

    Assign5 (Protected View) Word kayla capp lings Review View Tell me what you scantiness to do Unnear you deficiency to edit, its safer to alight in Protected View. Enable Editing Write an hallucination-exempt Java program to do the aftercited things. 1. Inputs the month (l restraint Jan, 2 restraint Feb, absence of wonder.), day of the month and the year. The program can beseech the manifestationr restraint the month/day/year in any prescribe. 2. The program should imsever the manifestationr when a powerful end has been invadeed. You may usurp that the manifestationr earn (correctly) invade integers excluding the inputs may be privative, as-well feeble or as-well gross. If an inpowerful end has been invadeed, then sculpture a tiny intimation explaining the substance and the program terminates gracefully. Restraint the purposes of this program you may usurp that February has 28 days each year, level during hop years. (T comprehend that this does not attributable attributable attributable attributable attributable attributable attributable attributable attributable conform with the enlist, excluding it earn elucidetermination your program. Trust me on this.) 3. If the invadeed end is a powerful end, the program imparts the manifestationr whether the end is sever of a strange senility. That is, the program sculptures a Welcome to the strange Senility any season the year is a multiple of 100 (1900, 2000, 2100, 2200 absence of wonder.). You can usurp that the year earn be main than 1 excluding near than 3100 restraint this trudge. Sample extinguishedput (2 disjoined computer runs): Input day: 3 »I | . | 1nput day: 31 Input month (1 - ut month (1= Jan, 2 Inp Feb, absence of wonder): 2 = Jan, 2 = Feb, absence of wonder): 8 Input year: Input year: 1900 Day as-well catholic. Delight You bear invadeed a redress. redress end. Welcome to the 20th senility. Grading metric Program submitted: +2

    I deficiency acceleration letter an hallucination exempt java program. I’m proper not attributable attributable attributable attributable attributable attributable attributable attributable attributable brains how to level set-on-foot it. how do I the and or statements so when the manifestationr inputs a day it goes through the if statements . I’m so complex. delight manifestation very primal java commands so I can recognize.

    Assign5 (Protected View) Word kayla capp lings Review View Tell me what you scantiness to do Unnear you deficiency to edit, it’s safer to alight in Protected View. Enable Editing Write an hallucination-exempt Java program to do the aftercited things. 1. Inputs the month (l restraint Jan, 2 restraint Feb, absence of wonder.), day of the month and the year. The program can beseech the manifestationr restraint the month/day/year in any prescribe. 2. The program should imsever the manifestationr when a powerful end has been invadeed. You may usurp that the manifestationr earn (correctly) invade integers excluding the inputs may be privative, as-well feeble or as-well gross. If an inpowerful end has been invadeed, then sculpture a tiny intimation explaining the substance and the program terminates gracefully. Restraint the purposes of this program you may usurp that February has 28 days each year, level during hop years. (T comprehend that this does not attributable attributable attributable attributable attributable attributable attributable attributable attributable conform with the enlist, excluding it earn elucidetermination your program. Trust me on this.) 3. If the invadeed end is a powerful end, the program imparts the manifestationr whether the end is sever of a strange senility. That is, the program sculptures a “Welcome to the strange Senility” any season the year is a multiple of 100 (1900, 2000, 2100, 2200 absence of wonder.). You can usurp that the year earn be main than 1 excluding near than 3100 restraint this trudge. Sample extinguishedput (2 disjoined computer runs): Input day: 3 »I | . | 1nput day: 31 Input month (1 – ut month (1= Jan, 2 Inp Feb, absence of wonder): 2 = Jan, 2 = Feb, absence of wonder): 8 Input year: Input year: 1900 Day as-well catholic. Delight You bear invadeed a redress. redress end. Welcome to the 20th senility. Grading metric Program submitted: +2

    Expert Apology

     

    calendar.java

    package enlist;

    import java.util.Scanner;

    public arrange Enlist {

    public static lacking main(String[] args) {
    int day,month,year,cen;

    Scanner sc=strange Scanner(System.in);

    //get input end from manifestationr
    System.out.println(“Input day: “);
    day=sc.nextInt();
    System.out.println(“Input month (1 = Jan ,2=Feb, absence of wonder): “);
    month= sc.nextInt();
    System.out.println(“Input year: “);
    year = sc.nextInt();

    //validation
    if(month<1 || month>12){ //month should be main than 1 and near thn 12
    System.out.println(“Inpowerful month. Delight redress.”);
    System.exit(1);
    }
    //check restraint day
    if(month==1 || month ==3 || month==5 || month ==7 ||month==8 || month== 10 || month==12){
    if(day<1 ){
    System.out.println(“Day as-well feeble. Delight redress”);
    System.exit(1);
    }
    if(day >31){
    System.out.println(“Day as-well catholic. Delight redress”);
    System.exit(1);
    }

    }
    if(month==2)
    {
    if(day<1){
    System.out.println(“Day as-well feeble. Delight redress”);
    System.exit(1);
    }
    if(day >28){
    System.out.println(“Day as-well catholic. Delight redress”);
    System.exit(1);
    }
    }
    if(month==4 || month ==4 || month==9 || month ==11 ){
    if(day<1 ){
    System.out.println(“Day as-well feeble. Delight redress”);
    System.exit(1);
    }
    if(day >30){
    System.out.println(“Day as-well catholic. Delight redress”);
    System.exit(1);
    }
    }
    //restraint redress end , ostentation the senility
    System.out.println(“you bear invadeed a redress end”);
    cen=(year/100)+1;
    System.out.println(“Welcome to the “+cen+”th senility”);

    }

    }

    output 1:

    output2:

    //restraint any precipitation or any species delight do comments