Question: (Car-Pool Savings Calculator) Research several car-pooling websites. Create an application that calculates your daily driving cost, so that you can estimate how much money


(Car-Pool Savings Calculator) Research several car-pooling websites. Create an application that calculates   

your daily driving cost, so that you can estimate how much moneycould be saved by car pooling, which also has other advantages such

(Car-Pool Savings Calculator) Research several car-pooling websites. Create an application that calculates your daily driving cost, so that you can estimate how much money could be saved by car pooling, which also has other advantages such as reducing carbon emissions and reducing traffic congestion. The application should input the following information and display the user's cost per day of driving to work: a) Total miles driven per day. b) Cost per gallon of gasoline. c) Average miles per gallon. d) Parking fees per day. e) Tolls per day. 123 import java.util.Scanner; public class CarpoolingApp { public static void main(String[] args) 4 5 { 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 //Using Scanner Scanner input = new Scanner(System.in); // Declare of each variable int totalMilesDriven, numberDay; int parkingFees; double milesDay; double gallon; double costGallons; double milesGallon; double parkingFees Amount; double tollDay; int cost; // Enter of the user System.out.print ("Total Miles Driven of the user: "); totalMilesDriven = input.nextInt(); System.out.print("Number days of the user: "); numberDay = input.nextInt(); System.out.print ("Number of gallon of gasoline that the user using: "); gallon = input.nextDouble(); System.out.print ("Cost of the user: "); cost = input.nextInt(); System.out.print("Parking Free: "); parkingFees = input.nextInt(); // Calculate milesDay = totalMiles Driven numberDay; 18 19 20 21 22 23 24 25 26 27 28 29 ava pr 16 17. double parking Fees Amount; double tollDay; int cost; // Enter of the user System.out.print("Total Miles Driven of the user: "); totalMilesDriven = input.nextInt(); System.out.print("Number days of the user: "); number Day = input.nextInt(); System.out.print("Number of gallon of gasoline that the user using: "); gallon = input.nextDouble(); System.out.print("Cost of the user: "); cost = input.nextInt(); System.out.print("Parking Free: "); 30 parkingFees = input.nextInt(); 31 32 33 34 35 36 37 // Calculate milesDay = totalMiles Driven numberDay; costGallons = cost / gallon;| milesGallon = totalMiles Driven / gallon; parkingFees Amount = parking Fees / numberDay; tollDay = ((costGallons + parking Fees Amount)/number Day); 38 39 //Display the information money of the user 40 41 42 43 44 System.out.printf("Total miles driven per day: %f ", milesDay); System.out.printf("Cost per gallon of gasoline: %f ", costGallons ); System.out.printf("Average miles per gallons: %f ", milesGallon); System.out.printf("Parking fees per day: %f ", parkingFees Amount); System.out.printf("Tolls per day: %f ", tollDay); 45 } 46 } 67

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!