Ask Question

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.

+2
Answers (1)
  1. 21 January, 16:41
    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 & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers