Question
Description: You will be working on a comprehensive problem throughout the semester. The program you will be writing will calculate the cost of a vehicle
Description: You will be working on a comprehensive problem throughout the semester. The program you will be writing will calculate the cost of a vehicle for the user and will become more complex as the semester progresses. Your solution to the problem will incorporate the Java capabilities you learn with each chapter. Chapter 2 Specifications: 1. You are to ask for and get from the user the following information (in the order specified below) and save it in the the variables as listed (name and type). Declare all variables at the beginning of your program. String firstName String lastName int vehicleYear String vehicleMake String vehicleModel double vehiclePrice double interestRate double downPayment double milesPerGallon double costGallonFuel int milesPerYear 2. Calculate and save all information in the variable as specified by type and name. Assume that the user will be keeping the vehicle for 5 years and will have a 5 year loan. The bookValue * (2 * 100% / Useful Life of Asset in Years) depreciation in year 1 (double depreciationYear1) depreciation in year 2 (double depreciationYear2) depreciation in year 3 (double depreciationYear3) depreciation in year 4 (double depreciationYear4) depreciation in year 5 (double depreciationYear5) h. Total depreciation (double totalDepreciation) i. Annual excise tax calculated as follows: 90% * vehiclePrice/1000 * 25 (double exciseTaxYear1) 60% * vehiclePrice/1000 * 25 (double exciseTaxYear2) 40% * vehiclePrice/1000 * 25 (double exciseTaxYear3) 25% * vehiclePrice/1000 * 25 (double exciseTaxYear4) 10% * vehiclePrice/1000 * 25 (double exciseTaxYear5) j. Total excise tax (double totalExciseTax) k. Annual insurance calculated as follows: N.B. bookValue = vehiclePrice - depreciation taken in all prior years. N.B. Insurance is calculated at the beginning of the year. vehiclePrice * 1% + bookValue * 2% (double insuranceYear1) vehiclePrice * 1% + bookValue * 2% (double insuranceYear2) vehiclePrice * 1% + bookValue * 2% (double insuranceYear3) vehiclePrice * 1% + bookValue * 2% (double insuranceYear4) vehiclePrice * 1% + bookValue * 2% (double insuranceYear5) l. Total insurance (double totalInsuranceCost) m. Annual cost of fuel (double annualFuelCost) n. Total cost of fuel (double totalFuelCost) o. Annual inspection(int ANNUALINSPECTIONCOST) this is a constant value of $29 p. Total inspection cost (int totalInspectionCost) q. Biannual registration cost (int BIANNUALREGISTRATIONCOST) this is a constant value of $50 charged in a biannual basis (every other year) starting in the first year of ownership. r. Total registration cost (int totalRegistrationCost) s. Plate cost (int PLATECOST) this is a onetime cost charged in the first year of ownership it is a constant value of $50 t. Total plate cost (int totalPlateCost) Chapter 2 Output: 1. Your program is to output to the screen as specified below (output values will depend on input values). Print dollar signs ($) when appropriate. Print all dollar values to two decimal points. Print all decimal values to four decimal points. Please enter your first name: Mickey Please enter your last name: Mouse Please enter the year of the vehicle: 2013 Please enter the make of the vehicle: Porsche Please enter the model of the vehicle: Carrera Please enter the price of the vehicle: 100000 Please enter the interest rate on your loan: .07 Please enter the down payment you will make: 20000 Please enter the average miles per gallon: Excise Tax: $250.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $1259.20 Interest: $3009.15 Plate: $0 Registration: $50 Repair and Maintenance: $5000.00 The total costs will be: Total vehicle cost: $115045.75 Total depreciation cost: $92224.00 Total excise tax cost: $5625.00 Total fuel cost: $21000.00 Total inspection cost: $145 Total insurance cost: $9611.20 Total interest cost: $15045.75 Total plate cost: $50 Total registration cost: $150 Total repair and maintenance cost: $15000.00
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started