Develop a Java application that provides program output in a logical manner and incorporates appropriate data types. Similar to zyBooks examples in Chapter 2, your program should prompt a user to enter a car brand, model, year, starting odometer reading, ending odometer reading, and gallons used. The output should include this information along with the estimated miles per gallon consumed by the vehicle in the format MPG: your calculation. Print each on separate lines with the appropriate labels (example, MPG: 25) Submit your source code and screenshots of the application executing with output in a single document.
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Here a new java program with name "Main.java" is created, which contains following code.
Main.java :
import java.util.*;//import package
public class Main //Java class
{ //entry point of program , main method
public static void main(String[] args) {
//creating object of scanner class
Scanner input=new Scanner(System.in);
//asking user to enter car brand
System.out.print("Enter Car Brand :
");
String
carBrand=input.nextLine();//reading carBrand
//asking user to enter car
model
System.out.print("Enter Car model :
");
String
model=input.nextLine();//reading model
//asking user to enter car
year
System.out.print("Enter Car year :
");
int year=input.nextInt();//reading
year
//asking user to enter starting
odometer reading
System.out.print("Enter Car
starting odometer reading : ");
double
startingOdometerReading=input.nextDouble();//reading starting
odometer reading
//asking user to enter ending odometer reading
System.out.print("Enter Car ending
odometer reading : ");
double
endingOdometerReading=input.nextDouble();//reading ending odometer
reading
//asking user to enter gallons
used
System.out.print("Enter gallons
used : ");
double
gallons=input.nextDouble();//reading gallons used
//calculate MPG
double
MPG=(endingOdometerReading-startingOdometerReading)/gallons;
//print car details
System.out.println("---------CAR
DETAILS----------------");
System.out.println("Car Brand :
"+carBrand);//print car brand
System.out.println("Car Model :
"+model);//print car model
System.out.println("Car Year :
"+year);//print car year
System.out.println("Car starting
odometer reading : "+startingOdometerReading);//print starting
odometer reading
System.out.println("Car ending
odometer reading : "+endingOdometerReading);//print ending odometer
reading
System.out.println("Gallons Used :
"+gallons);//print gallons
System.out.println("MPG:
"+MPG);//print MPG
}
}
======================================================
Output : Compile and Run above program to get the screen as shown below
Screen 1 :Main.java

NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
Develop a Java application that provides program output in a logical manner and incorporates appropriate data...
Please answer this question as if you have NO coding experience. Develop a Python application that incorporates using appropriate data types and provides program output in a logical manner. Your program should prompt a user to enter a car brand, model, year, starting odometer reading, an ending odometer reading, and the estimated miles per gallon consumed by the vehicle. Store your data in a dictionary and print out the contents of the dictionary. I'm this far but cannot get it...
Write a program to compute miles per gallon of a car, over a long trip. The car begins the trip with a full tank, and each fuel stop along the way fills the tank again. You will not do any math, arithmetic, or computations in the main() function. All output will be displayed from the main() function. Start the program by asking the user for the starting odometer reading. All odometer readings will be in whole miles only. The fuel...
A liter is 0.264179 gallons. Write a program that will read in the number of liters of gasoline consumed by the user's car and the number of miles per gallon the car delivered. Your program should allow the user to repeat this calculation as often as the user wishes. Define a function to compute the number of miles per gallon. Your program should use a globally defined constant for the number of liters per gallon. After doing this... Modify your...
Use a java program that does the following:
. (10 points) Write a program as follows a. Prompt the user to input two positive integers: nl and n2 (nl should be less than n2) b. If the user enters the negative number(s), convert it/them to positive number(s) c. If nl is greater than n2, swap them. d. Use a while loop to output all the even numbers between nl and n2 e. Use a while loop to output the sum...
Write program in JAVA with a method that returns an array. The method should accept as input a comma-delimited string with three values from a user. The array should store each value in a different element. Use Try..Catch error handling and print any failure messages, or print success from within method if execution is successful (see Chapter 13 in the text). Call the method from the main method of the program to demonstrate its functionality by looping through the array...
// Enter your name as a comment for program identification // Program assignment TripCost.cpp // Enter your class section, and time /* The program TripCost.cpp uses pointers to calculate the cost of a trip depending on the cost of a gallon of gas, the number of miles, and the number of miles per gallon a car gets. */ /* The cost of gas, the number of miles, and number of miles per gallon is entered. */...
Programming Language is Java Lab 1: Programming Exercises Input/Process/Output 1) Run the Numbers. Write a program with two input values. The program should display the sum, difference, quotient, product, and average of the two numbers. 2) Jake’s Problem. Jake has a car with an 8-gallon fuel tank. Jake fills his tank with gas and drives 60 miles to a friend’s house. When he gets to his friend’s house, he has 6 gallons left in his fuel tank. Write a program...
Java Programming. Please make sure program compiles, the code is
copyable, and screenshots of the output are provided for 5 stars
:-) Calculation for speed is just supposed to be google
searched
1) 18 points] You've been hired by Pedal Punchers to write a Java console application that estimates bicycle speed in miles per hour. Use a validation loop to prompt for and get from the user the wheel diameter of a bicycle in inches in the range 10-50. Then...
You previously wrote a program that calculates and displays: Miles driven Miles per gallon Kilometers driven Liters of fuel consumed Kilometers per liter Messages commenting on a vehicle's fuel efficiency And also validates input Now we'll make a somewhat major change. We'll remove the code for obtaining input from a user and replace it with hardcoded data stored in lists. Because the data is hardcoded, the program will no longer need the code for validating input. So, you may remove...
Develop a Java program that will store data in the form of daily average temperatures for one week. Store the day and average temperature in two different arraylists. Your program should prompt the user for the day of the week (Monday through Sunday) and display both the day and temperature for each day. If “week” is entered, the output for your program should provide the temperature for each day and the weekly average. Use the looping and decision constructs in...