Ask Question
9 June, 14:23

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. 9 June, 18:22
    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?
Find 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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers