Mr. Gottsacker
Computer Programming
This project is designed for groups of two people.
Write a program called GasPoweredTripCalculator.java
that collects the following information from the user about a gas-powered vehicle:
Electric vehicles require a less straightforward method for computing the cost of one trip. Instead of miles per gallon, EVs have a mileage per battery charge. To arrive at cost per trip, this means you first have to figure out how much it costs to charge a battery, and then determine how much of the battery is spent on each trip. Each EV battery holds a number of kilowatt-hours (kWh). To calculate how much it costs to charge a battery, you can multiply the battery's kilowatt-hours capacity by the cost of a kilowatt-hour. Then, you can divide the result by the EV's mileage to determine how much it costs to drive the EV one mile.
Note: The cost of one kilowatt-hour is usually around $0.10 in the United States.
Write a program called ElectricTripCalculator.java
that collects the following information from the user about an electric vehicle:
Suppose you are considering buying a new Rivian truck. With a fully charged 105 kWh battery, it can travel 230 miles. It costs $69,000. Use the Java programs you wrote to determine whether buying the Rivian is a good idea as a replacement for your gas-powered car. Compute the cost of a typical trip using each of the vehicles. Will the price of the Rivian ever pay for itself? In other words, will the savings from the Rivian on each trip eventually cover the price of the new vehicle? If so, after how many miles? After how many trips? You may write another Java program or simply use a calculator to compute how many trips it would take to cover the cost.
To complete this task, you should keep the following things in mind:
Put the details of your project in a report format. This report can be in a .txt file, Google Doc, or some other portable document format. Whenever you use the Internet to find information, include a link to the source of that information. Your report should contain the following information:
I will share a Google Drive folder titled with the last names of the group members. Upload your GasPoweredTripCalculator.java
file, ElectricTripCalculator.java
file, and Project Report file directly into that folder.