Question: I need help on question 2. pating-point value from the input and assigns current Temp with that value Figure 2.7.1: Variables of type double: Travel
pating-point value from the input and assigns current Temp with that value Figure 2.7.1: Variables of type double: Travel time example. inport java util. Scanner; public class TravelTime ( public static void sain (String [1 args) ( Scanner scnr new Scanner(System.in); double nilesTravel; / User input of miles to travel double hoursFly; // Travel hours if flying those miles 1 Enter distance in miles: 1800 1809.0 miles would take: 3.6 hours to fly 38.8 hours to drive double hoursDrive; /7 Travel hours if driving those miles Systen.out print("Enter distance in niles: ): milesTravel schr.nextDouble); Enter distance in "les: 400.5 408.5 miles would take: hoursDrive milesTravel 60.; 0.801 hours to fly 6.675 hours to drive Systen out.printin(nilesTravel"miles would take:") System.out.printinhoursFly+ hours to fly,"): System.out.printinhours0rive+hours to drive.) Feedback? PARTICIPATION ACTIVITY 2.7.1: Declaring and assigning double variables All variables are of type double and already-declared unless otherwise noted. 1) Declare a double variable named personHeight Check Show answer 2) Declare a double variable named packageWeight and initialize the variable to 7.1 Check Show
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
