Question
JAVA PROJECT! 1. Revise the calculation of and save (as specified by type and name ) the values below or take the specified action: A.
JAVA PROJECT!
1. Revise the calculation of and save (as specified by type and name ) the values below or take the specified action:
A. Use a do/while loop to ask the user to enter the vehicle year (vehicleYear). Use the statement Please enter the vehicle year, must >= 1886 and <= 2018 You are to trap the user (asking them to reenter the vehicle year, in the loop) if vehicleYear < 1886 or > 2018.
B. Use a do/while loop to ask the user to enter the amount of the price of the vehicle (vehiclePrice). Use the statement Please enter the vehicle price, must be >= 0. You are to trap the user (asking them to reenter the price of the vehicle in the loop) if vehiclePrice is < 0 C. Use a do/while loop to ask the user to enter the interest rate (interestRate). Use the statement Please enter the interest rate, must be >= 0. You are to trap the user (asking them to reenter the interest rate in the loop) if the interest rate is < 0. If the user enters a value greater than or equal to 1 for interestRate divide the amount entered by 100 and save to interestRate and print to the screen a message advising the user the value stored in interestRate.
D. Use a do/while loop to ask the user to enter the amount of the down payment (downPayment). Use the statement Please enter the down payment you will make, must be >= 0 and >= 20% of the purchase price if the vehicle is used. You are to trap the user in the loop (asking them to reenter the downpayment in the loop) if the vehicle is used and the the amount of the downpayment is less than 20% of vehiclePrice or if downPayment < 0.
E. Use a do/while loop to ask the user to enter the amount of the miles per gallon (milesPerGallon). Use the statement Please enter the miles per gallon, must be >= 0. You are to trap the user (asking them to reenter the miles per gallon in the loop) if milesPerGallon < 0.
F. Use a do/while loop to ask the user to enter the amount of the cost per gallon of fuel (costGallonFuel). Use the statement Please enter the cost per gallon of fuel, must be >= 0. You are to trap the user (asking them to reenter the cost per gallon of fuel, in the loop) if costGallonFuel < 0.
G. Use a do/while loop to ask the user to enter the number of miles driven per year (milesPerYear). Use the statement Please enter the total miles driven per year, must be >= 0. You are to trap the user (asking them to reenter the total miles driven per year, in the loop) if milesPerYear < 0.
H. Use a do/while loop to ask the user to enter the number of years they have been driving (numberOfYearsYouHaveBeenDriving). Use the statement Please enter the number of years you have been driving, must be >= 0. You are to trap the user (asking them to reenter the number of years they have been driving in the loop) if numberOfYearsYouHaveBeenDriving < 0.
I. Use a do/while loop to ask the user to enter the number of surchargeable points (numberOfSurchargeablePoints). Use the statement Please enter the surchargeable points, must be >= 0. You are to trap the user (asking them to reenter the surchargeable points in the loop) if numberOfSurchargeablePoints < 0.
J. Use a do/while loop to ask the user to enter the number of years without surchargeable points (numberOfConsecutiveYearsWithZeroSurchargeablePoints). Use the statement Please enter the number of consecutive years without surcharge able points, must be >= 0. You are to trap the user (asking them to reenter the number of consecutive years without surchargeable points in the loop) if numberOfConsecutiveYearsWithZeroSurchargeablePoints < 0.
Output:
1. Your program is to output the information 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. N.B. if the user enters invalid information the messages specified above and in prior chapter specifications will print to the screen.
Please enter your first name: Mickey
Please enter your last name: Mouse
Please enter the year of the vehicle, must be 1886 - 2018 2013
Please enter the make of the vehicle: Porsche
Please enter the model of the vehicle: Carrera
Please enter the price of the vehicle, must be > 0: 100000
Please enter the interest rate on your loan, must be >= 0: .07
Please enter the down payment you will make, must be >= 0: 20000
Is the vehicle new, please enter true or false: false
Please enter the average miles per gallon, must be >= 0: 10
Please enter the average cost of gas per gallon, must be >= 0: 3.5
Please enter the average miles driven per year, must be >= 0: 12000
Please enter the number of years you have been driving, must be >= 0: 10
Please enter your number of surchargeable points, must be >= 0: 5
Please enter the number of consecutive years you have been driving in which you did not earn surchargeable points: 2 Please enter the vehicle code using the chart below :
Code
Description
Weight
A Passenger 1,500 - 1,999 lb
B Passenger 2,000 - 2,499 lb
C Passenger 2,500 - 2,999 lb
D Passenger 3,000 - 3,499 lb
E Passenger 3,500 lb and over
F SUV na
G Pickup na
H Van na
B
Cost analysis prepared for: Mickey1 Mouse.
The costs of buying and owning a 2013 Porsche Carrera are as follows: Purchased for $100000.00 with a downpayment of $20000.00 and an interest rate of 0.0700 on a loan of $80000.00:The monthly loan payment will be $1584.10 per month.
Year 1 annual additional costs will be: Depreciation: $40000.00 Excise Tax: $2250.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $3800.00 Interest: $3009.15 Plate: $50 Registration: $50 Repair and Maintenance: $1000.00
Year 2 annual additional costs will be: Depreciation: $24000.00 Excise Tax: $1500.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $3000.00 Interest: $3009.15 Plate: $0 Registration: $0 Repair and Maintenance: $2000.00
Year 3 annual additional costs will be: Depreciation: $14400.00 Excise Tax: $1000.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $2520.00 Interest: $3009.15 Plate: $0 Registration: $50 Repair and Maintenance: $3000.00
Year 4 annual additional costs will be: Depreciation: $8640.00 Excise Tax: $625.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $2232.00 Interest: $3009.15 Plate: $0 Registration: $0 Repair and Maintenance: $4000.00
Year 5 annual additional costs will be: Depreciation: $5184.00 Excise Tax: $250.00 Fuel: $4200.00 Inspection Cost: $29 Insurance: $2059.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: $13611.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