Question
The customer wishes to purchase a new vehicle from the Automated Car Dealership software program; dealer.c . In dealer.c , the customer will enter their
The customer wishes to purchase a new vehicle from the Automated Car Dealership software program; dealer.c. In dealer.c, the customer will enter their annual salary in the command line and the software program will output the cars affordable for the customer. The customer will then be allowed to browse the available vehicles by manufacturer and make/model. Once the customer makes a selection, the program displays the customer's selection along with the monthly payments.
GIVEN: list available vehicles, description of "affordable vehicle" function.
List (Car.txt):
manufacturer,make,model,price
"Toyota","Toyota","Corolla",21550 "Toyota","Toyota","Camry",25945 "Toyota","Toyota","Avalon",36825 "Toyota","Toyota","Mirai",49500 "Toyota","Toyota","Sequoia",58300 "Toyota","Toyota","Tacoma",27250 "Toyota","Toyota","Tundra",36965 "Toyota","Lexus","IS",40585 "Toyota","Lexus","ES",42490 "Toyota","Lexus","GX",57575 "Chevrolet","Chevy","Trailblazer",22100 "Chevrolet","Chevy","Camaro",26100 "Chevrolet","Chevy","Equinox",26600 "Chevrolet","Chevy","Traverse",34520 "Chevrolet","Chevy","Tahoe",54200 "Chevrolet","Chevy","Suburban",56900 "Chevrolet","Chevy","Corvette",64500 "Chevrolet","Chevy","Spark",13600 "Chevrolet","Chevy","Trax",21700 "Chevrolet","Chevy","Malibu",23400 "Nissan","Nissan","Versa",18990 "Nissan","Nissan","Sentra",22700 "Nissan","Nissan","Altima",35385 "Nissan","Nissan","Maxima",43300 "Nissan","Nissan","Pathfinder",50660 "Nissan","Nissan","Rogue",38640 "Nissan","Nissan","Murano",46910 "Nissan","Infiniti","Q50",42650 "Nissan","Infiniti","QX55",49150 "Nissan","Infiniti","QX80",72700 "BMW","BMW","2 Series Coupe",38050 "BMW","BMW","3 Series Sedan",48220 "BMW","BMW","4 Series Convertible",59320 "BMW","BMW","5 Series Sedan",55175 "BMW","BMW","7 Series Sedan",93400 "BMW","BMW","X1",39700 "BMW","BMW","X3",46050 "BMW","BMW","X4",54050 "BMW","BMW","X5",75400 "BMW","BMW","X7",77850 "Volkswagen","VW","Jetta",18995 "Volkswagen","VW","Passat",23995 "Volkswagen","VW","Arteon",36995 "Volkswagen","Audi","Q5",43500 "Volkswagen","Audi","Q3",38700 "Volkswagen","Audi","S6",72700 "Volkswagen","Audi","A6",55900 "Volkswagen","Porsche","Panamera",132760 "Volkswagen","Porsche","Macan",69480 "Volkswagen","Porsche","Cayenne",92960
Function description: Customer can comfortably afford a vehicle with a monthly payment of maximum 15% of gross salary. A vehicle monthly payment can be describe as: (P+P*Q*R)/(R*12); P = principle (price of vehicle - down payment), Q = Interest (based on salary), R = rate (5 years). For the CSC362 Automated Car Dealership, the interest rates are as followed based on annual salary:
Over 125k/4.79% 125k - over 80k/6.55% 80k - over 45k/9.49% 45k and under/13.28%
------------------------------------------------------
Input: >>./a.out 60000
Desired Output: Enter Down Payment: 5000 Available Manufacturers: 1) Toyota 2) Chevrolet 3)VW Group 4) Nissan Select Manufacturer: 1 Available Make/Model: 1) Toyota Tacoma - $27250.00 2) Toyota Camry - $25945.00 3) Toyota Corolla - $21550.00
Select Make/Model: 2 You selected the Toyota Camry. Your monthly payment is $514.72.
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