Docsity

Vehicle Purchase Assistance Program - Prof. Jose Morales, Assignments of Javascript programming

Toggle sidebar
bg1
COP 2250 TR 625-740PM
HOMEWORK 2
DUE: Tuesday October 14, 2008 @ 6:25 PM
Write a program that will assist a person to choose a vehicle to buy. The program will
start by presenting a main menu to the user with five options.
1. V- Choose Vehicle Type
2. P - Calculate a Payment Plan
3. M - Car Maintenance
4. T - Estimated Trade in Value
5. Q - Quit
An option is chosen by either entering the number or the letter in uppercase for each
choice above. Use the Switch Statement for the menu. Each choice should be handled as
follows:
1. V- Choose Vehicle Type
For this option, gather information by asking the user which of the following options the
vehicle should have: transmission manual or automatic; two wheel or four wheel drive;
power windows, power doors, sun roof, two doors or four doors, extra carrying capacity,
global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd
player. Based on the users answers, one of the following three vehicles can be suggested:
Ford F150 XLT Truck when:
Two wheel drive yes and no
Four wheel drive yes and no
Power windows yes and no
Power doors yes and no
Sun roof no
Two doors yes and no
Four door yes and no
Extra carrying capacity yes
global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd
player yes and no
Lamborghini Diablo
Two wheel drive yes and no
Four wheel drive yes and no
Power windows yes
Power doors yes
Sun roof no
Two doors yes
Four doors no
Extra carrying capacity no
global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd
player yes and no
pf3

Partial preview of the text

Download Vehicle Purchase Assistance Program - Prof. Jose Morales and more Assignments Javascript programming in PDF only on Docsity!

COP 2250 TR 625-740PM

HOMEWORK 2

DUE: Tuesday October 14, 2008 @ 6:25 PM Write a program that will assist a person to choose a vehicle to buy. The program will start by presenting a main menu to the user with five options.

  1. V- Choose Vehicle Type
  2. P - Calculate a Payment Plan
  3. M - Car Maintenance
  4. T - Estimated Trade in Value
  5. Q - Quit An option is chosen by either entering the number or the letter in uppercase for each choice above. Use the Switch Statement for the menu. Each choice should be handled as follows:
  6. V- Choose Vehicle Type For this option, gather information by asking the user which of the following options the vehicle should have: transmission manual or automatic; two wheel or four wheel drive; power windows, power doors, sun roof, two doors or four doors, extra carrying capacity, global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd player. Based on the users answers, one of the following three vehicles can be suggested:

Ford F150 XLT Truck when: Two wheel drive yes and no Four wheel drive yes and no Power windows yes and no Power doors yes and no Sun roof no Two doors yes and no Four door yes and no Extra carrying capacity yes global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd player yes and no

Lamborghini Diablo Two wheel drive yes and no Four wheel drive yes and no Power windows yes Power doors yes Sun roof no Two doors yes Four doors no Extra carrying capacity no global satellite positioning system installed, mp3 player, lcd tv, satellite television, dvd player yes and no

Toyota Corolla Two wheel drive yes Four wheel drive no Power windows yes and no Power doors yes and no Sun roof yes and no Two doors yes and no Four door yes and no Extra carrying capacity no global satellite positioning system installed yes mp3 player, lcd tv, satellite television, dvd player yes and no

  1. P - Calculate a Payment Plan For this option, ask the user what is the maximum amount of money they want to pay to purchase a vehicle, how many years they want to fully pay off the vehicle price, and the person’s annual salary and credit rating. Calculate the payment plan as follows: If the person’s salary is below $25,000/year then the interest is 12% If the person’s salary is between $25,000 and $60,000 then the interest is 18% If the person’s salary is over $60,000 then the interest is 6% If the person’s credit rating is between 0 and 3 the credit fee is $750. If the person’s credit rating is between 4 and 7 the credit fee is $500. If the person’s credit rating is greater than 7 the credit fee is $25. The payment plan is calculated as follows: Monthly payment = (((vehicle price * interest)+credit fee)/number of months to pay) Number of months = number of years to pay off car * 12
  2. M - Car Maintenance In this option, ask the user to choose from 3 types of vehicles: car, truck, suv, and ask for the type of maintenance plan: there are three types: full, partial, minimal. The car maintenance pricing is as follows; print out the appropriate one for the user: Car: full $500.00 partial $300.00 minimal $225. Truck: full $1,000.00 partial $800.00 minimal $6. SUV: full $2500.00 partial $1350.00 minimal $1100.
  3. T - Estimated Trade in Value For this option ask the user to enter the year of the vehicle, the current mileage, and vehicle type which is one of the following three options, import car, domestic suv, diesel truck. The estimated trade in value is calculated as follows: Start with $50,000 base value If the year of the car is before 1990 subtract 12,000 from base value If the mileage is above 75,000 miles subtract 30,000 from base value If the mileage is between 40,000 and 75,000 miles subtract 15,000 from base value. If the vehicle is an import car subtract 4,000 from base value If the vehicle is a domestic suv subtract 2,000 from base value If the vehicle is a diesel truck subtract $500.