Question: I modified the code so that it prompts the user to enter the course code and course title. Whenever I type in CSCI 1010 for

 I modified the code so that it prompts the user to enter the course code and course title. Whenever I type in "CSCI 1010" for the course code it skips over the course title prompt ,but when I type in something random I get both prompts.

Scanner keyboard = new Scanner(System.in); System.out.println("Please enter your course code: "); String

Scanner keyboard = new Scanner(System.in); System.out.println("Please enter your course code: "); String cNumber keyboard.next(); System.out.println(); System.out.println("Please enter your course title: "); String cTitle = keyboard.next();

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!