Considering Leasing Cost To simplify our model assume leased cars. When leasing a car we only consider: The amount in dollars due at signing The number months for the entire lease  The lease monthly cost The mileage allowance per month The cost of the charger if the vehicle is an electrical car We also consider the price of gas for gasoline-powered vehicles and electricity for electricity-powered vehicles. Because both gasoline and electricity prices vary from time to time, we will obtain this information from the user when we execute the program. We can break down the total cost into 2~3 parts: Fuel cost: totalMiles / milesPerUnitOfFuel * fuelPrice Lease cost: dueAtSigning + (numberOfMonths*monthlyCost) Charger cost if the vehicle is electric Then we can find the total cost to lease a car by simply summing all parts together. Considering Carbon Emissions Many people choose to buy an electric car, not because of cost but out of concern for the environment. This is a benefit that is difficult to fully capture, but certain things like greenhouse gas emissions can be measured. Greenhouse gases (GHGs) trap heat in the Earth’s atmosphere and are believed to contribute to global climate change. Carbon dioxide (CO2) is the main GHG produced by human activity, and the two major human activities responsible for CO2 emission are electric power generation and combustion of fossil fuels for transportation. You can read a little more about CO2 emission on the EPA website. Gas-powered car: According to the EPA, there are 8.887 kg of CO2 released with the combustion of each gallon of gasoline. This is the amount of CO2 coming out the tailpipe of a gas powered vehicle. Given the formula: Total emitted CO2 = gallonsOfGasUsed * 8.887 kg/gallon = totalMiles/milesPerGallon * 8.887 kg/gallon This means that we can estimate the total CO2 emitted over the 36 months lease of a vehicle. Assuming that a vehicle consumes 1 gallon of gas for every 34 miles and that the lease allowance milage is 1,000 miles per month, we can compute the number of gallons of gasoline needed to drive an estimated 36,000 miles and multiplying by 8.887kg/gal as follows: 36,000mi/(34 mi/gal) x 8.887 kg/gal = 1,058.82 gal x 8.887kg/gal = 9,409.76kg. To drive 36,000 miles, the vehicle uses 1,058.82 gallons of gasoline and produces 9,409.76 kg of CO2.   Electricity-powered car: According to the EPA’s Power Profiler website, 998.4 pounds of CO2 are emitted per mWh on average across the United States. For this assignment, since we are working with miles and kilograms, we can covert pounds to kilograms.There are about .45kg per pound. ( 998.4 lbs CO2/ MWh * 1MWh/1000Kwh * 0.45kg/lb ) = 0.453 kg/kWh (this data is provided to you in Fuel.java). Now, let us figure out how much CO2 is emitted in generating the electricity to charge the battery of an electricity-powered car over a 36 months lease by estimating the total energy for battery charging needed to drive 36,000 miles. A very similar formula can be used for electricity car here: Total CO2 = kW⋅hOfElectricityUsed * 0.453 kg/kW⋅h = totalMiles/milesPerKW⋅h * 0.453 kg/kW⋅h What you need to do for this assignment In this assignment, you will be provided with the following files:

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter16: Probabilistic Inventory Models
Section16.3: The News Vendor Problem: Discrete Demand
Problem 9P
icon
Related questions
Question

Considering Leasing Cost

To simplify our model assume leased cars. When leasing a car we only consider:

  1. The amount in dollars due at signing
  2. The number months for the entire lease 
  3. The lease monthly cost
  4. The mileage allowance per month
  5. The cost of the charger if the vehicle is an electrical car

We also consider the price of gas for gasoline-powered vehicles and electricity for electricity-powered vehicles. Because both gasoline and electricity prices vary from time to time, we will obtain this information from the user when we execute the program.

We can break down the total cost into 2~3 parts:

  1. Fuel cost: totalMiles / milesPerUnitOfFuel * fuelPrice
  2. Lease cost: dueAtSigning + (numberOfMonths*monthlyCost)
  3. Charger cost if the vehicle is electric

Then we can find the total cost to lease a car by simply summing all parts together.

Considering Carbon Emissions

Many people choose to buy an electric car, not because of cost but out of concern for the environment. This is a benefit that is difficult to fully capture, but certain things like greenhouse gas emissions can be measured.

Greenhouse gases (GHGs) trap heat in the Earth’s atmosphere and are believed to contribute to global climate change. Carbon dioxide (CO2) is the main GHG produced by human activity, and the two major human activities responsible for CO2 emission are electric power generation and combustion of fossil fuels for transportation. You can read a little more about CO2 emission on the EPA website.

Gas-powered car:

According to the EPA, there are 8.887 kg of CO2 released with the combustion of each gallon of gasoline. This is the amount of CO2 coming out the tailpipe of a gas powered vehicle.

Given the formula:

Total emitted CO2 gallonsOfGasUsed * 8.887 kg/gallon

= totalMiles/milesPerGallon * 8.887 kg/gallon

This means that we can estimate the total CO2 emitted over the 36 months lease of a vehicle.

Assuming that a vehicle consumes 1 gallon of gas for every 34 miles and that the lease allowance milage is 1,000 miles per month, we can compute the number of gallons of gasoline needed to drive an estimated 36,000 miles and multiplying by 8.887kg/gal as follows:

36,000mi/(34 mi/gal) x 8.887 kg/gal = 1,058.82 gal x 8.887kg/gal = 9,409.76kg.

To drive 36,000 miles, the vehicle uses 1,058.82 gallons of gasoline and produces 9,409.76 kg of CO2.

 

Electricity-powered car:

According to the EPA’s Power Profiler website, 998.4 pounds of CO2 are emitted per mWh on average across the United States.

For this assignment, since we are working with miles and kilograms, we can covert pounds to kilograms.There are about .45kg per pound.

( 998.4 lbs CO2/ MWh * 1MWh/1000Kwh * 0.45kg/lb ) = 0.453 kg/kWh (this data is provided to you in Fuel.java).

Now, let us figure out how much CO2 is emitted in generating the electricity to charge the battery of an electricity-powered car over a 36 months lease by estimating the total energy for battery charging needed to drive 36,000 miles.

A very similar formula can be used for electricity car here:

Total CO2 = kW⋅hOfElectricityUsed * 0.453 kg/kW⋅h

= totalMiles/milesPerKW⋅h * 0.453 kg/kW⋅h

What you need to do for this assignment

In this assignment, you will be provided with the following files:

    1. Fuel.java
      1. Objects built from Fuel class contains informations of:
        1. Fuel type
        2. kg of CO2 emitted from 1 gallon of gas or 1 kWh of electricity
        3. Miles can the car drive per gallon of gas or kWh of electricity 
        4. Cost of the charger
      2. the Fuel objects built from it will be stored in Vehicle objects
    2. Lease.java
      1. Objects built from Lease class contains informations of:
        1. The total amount of cash that is due at the time a car lease contract is signed
        2. The length of the lease in month
        3. The monthly cost for the lease
        4. Mileage allowance per month during the lease
    3. Vehicle.java
      1. Objects built from Vehicle class contains:
        1. Name of the vehicle,
        2. A fuel object and a lease object described above
        3. The amount of CO2 emission during the lease 
          1. You need to calculate and set the value in LeasingCost.java
        4. The fuel cost and the total cost during the lease period
          1. You need to calculate and set the value in LeasingCost.java
    4. Vehicles.txt
      1. Text contains information about vehicles
    5. LeasingCost.java
      1. This is the only file you need to write code in.
      2. Provided methods:
        1. createAllVehicles (need createVehicle() for it to work)
        2. computeCO2
        3. computeFuelCost
        4. computeLeaseCost
        5. main
      3. Methods need to be completed
        1. createVehicle
          1. This method creates and returns a Vehicle object with name, Lease, and Fuel properly populated based on the given string
          2. The string given to this method is each line of description in vehicles.txt
        2. computeCO2EmissionsAndCost
          1. The method calculates and assigns CO2Emission, FuelCost, leastCost, of each vehicle.
          2. Use getter and setter methods to get and set values in each vehicle object
          3. For convenience, it is suggested to use: computeCO2(), computeFuelCost(), computeLeaseCost() with your calculation. To avoid unnecessary math mistakes.

$ javac LeasingCars.java

$ java LeasingCars vehicles.txt 3.85 11.0

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 1 images

Blurred answer
Knowledge Booster
Topological Sort
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole