What would the code to be to allow a user to input text and integers. I am creating a GPA Calculator and the program asks for what course the user is taking, which then is stored as a variable. For example. "Calculus 12." I was able to fix this issue by making the string and the integer two separate variables. How would I make it so that the user can type in "Calculus 12" and have the entire thing be stored as a variable with no issues?
System.out.println("For the next set of questions, please answer without typing in a number. ");
System.out.println("For example, 'Pre-Calculus'. ");
System.out.print( name + ", What is the 1st course are you taking? ");
course1 = keyboard.next();
System.out.print("What level is it? Type in a value: ");
num1 = keyboard.nextInt();