I'm using Scanner objects to get user inputs, but in the console after the enter key is pressed after the input, a new line is created. I just want it to jump to the next input area and not make a new line. Below is the output and after that is what happens after I press enter.
Please enter the number of residents in your house:
Please enter the area of the living space in square feet:
Please enter the Total monthly cost of internet:
Please enter the number of residents in your house: 5
Please enter the area of the living space in square feet:
Please enter the Total monthly cost of internet:
While the program does read the input, I have to manually use the arrow keys to enter the next one. Any help is appreciated. The actual code is below:
import java.util.Scanner;
//prints the House text-image
public class House{
public static void main(String[] args){
float monthlyInternet;
int numResidents, sqFeet;
Scanner sc = new Scanner(System.in);
System.out.println("Please enter the number of residents in your house: ");
System.out.println("Please enter the area of the living space in square feet: ");
System.out.println("Please enter the Total monthly cost of internet: ");
numResidents = sc.nextInt();
sqFeet = sc.nextInt();
monthlyInternet = sc.nextFloat();
System.out.println(" . _ _ _ _ _ .");
System.out.println(" / \\ _ _ _ _ _ \\");
System.out.println(" | | 0 0 |");
System.out.println(" |_| _ _ H _ _ |");
}//end main
}//end class