Ask Question
29 April, 14:13

rite two scnr. nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, and the year. End with newline.

+4
Answers (1)
  1. 29 April, 14:30
    0
    The Java code is given below with appropriate comments

    Explanation:

    //TestCode. java

    import java. util. Scanner;

    public class TestCode{

    public static void main (String[] args) {

    Scanner scnr = new Scanner (System. in);

    //initialising the birth month and birth year

    int birthMonth, birthYear;

    //getting the inputs for the birth month and birth year

    birthMonth = scnr. nextInt ();

    birthYear = scnr. nextInt ();

    //printing out the birth month and birth year, separated by a slash (/)

    System. out. println (birthMonth+"/"+birthYear);

    }

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “rite two scnr. nextInt statements to get input values into birthMonth and birthYear. Then write a statement to output the month, a slash, ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers