Question: Assuming import java.util.Scanner;, and the following variable declaration: Scanner in = new Scanner(System.in); Write an input statement for each of the five (5) variables declared

Assuming import java.util.Scanner;, and the following variable declaration: Scanner in = new Scanner(System.in); Write an input statement for each of the five (5) variables declared in the previous question. i. an integer variable for the number of hours -> int numHours; ii. a floating-point variable for the cost of train ticket -> double costTicket; iii. a floating-point variable for the distance from home to work -> double distanceHomeToWork; iv. an integer variable for the number of people attending a meeting -> int numPeople; v. a floating-point variable for the height of a house -> double heightHouse
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
