Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

for c program Problem Write a C program to keep records and perform statistical analysis for a car sales agency. The information of each car

for c program
image text in transcribed
image text in transcribed
Problem Write a C program to keep records and perform statistical analysis for a car sales agency. The information of each car contains the type of the vehicle, engine size, mileage, year, and price. Note that you cannot use while loops in the program. Program should accept information about 4 cars. We consider the program with two-dimensional array"database", where each row is an individual car, while columns represent parameters of a vehicle. 1) Function O_Car_Discount_6 that takes mileage, year and price as an argument and returns adjusted price of a car after applying discounts as per the below table. (25 points) =100,000km =2010 and 2015 3% 10% 40 2) Function O_Print_Car_6 that accepts a row of a database array. Function must call O_Car_Discount_6 to calculate discounted price of a car. Function must print vehicle engine size, mileage, price and discounted price as per sample output. Function must convert vehicle type to user-friendly format per table below (25 points): Vehicle Type Displayed Text 10 Hatchback 20 Sedan 30 SUV Minivan 3) O_Lot_info_6 that takes "database" array and prints out (25 points): The lowest mileage car. The cheapest car The oldest car 4) Main function should perform the following tasks. (25 points) Read the type of vehicle, engine size, mileage, year, and price from the user and stores it in "database" array. Prints list of cars from "database" with ID, year and price as per sample output. Ask the user which car he/she wants to see and call O_Print_Car_6 with respective row. If user inputs 999, exit the program. Calls O_Lot_info_6 as shown in the sample output Shows student information as per sample output. Sample output: ... EGAILA CAR SALES AGENCY DATABASE WELCOME TO SYSTEM Please enter body type, engine size, mileage, year, and price of the car #1 >> 10 2.4 180000 2005 200 Please enter body type, engine size, mileage, year, and price of the car #2 >> 20 3.0 10000 292e sebe Please enter body type, engine size, mileage, year, and price of the car 13 >> 13 4.5 seeee 2011 4eee Wrong vehicle type, please try again! Please enter body type, engine size, mileage, year, and price of the car #3 >> 3 4.5 seere 2011 4ece Please enter body type, engine size, mileage, year, and price of the car 4 >> 22 4.8 320000 2001 1000 >>>>> >>The lowest mileage on a lot: 1000 km >>The cheapest car on a lot: 1000 KD >>The oldest car on a lot is year 2001 >>>>> ID Year Price 1 2ees 3000 KD 2 2e2e seee KD 2011 4800 KD 4 2001 1800 KD >>>>> Please, enter ID of a car to view (or 999 to exit): 1 Car info: 2005 Hatchback Engine size: 2.4L Mileage: 18eeee KM Original Price: 3KD. Discounted price: 24KD 3 Please, enter ID of a car to view (or 999 to exit): 5 Wrong input! Please, try again! Please, enter ID of a car to view (or 999 to exit): 3 Car info: 2011 Suv Engine size: 4.5L Mileage: 50000 KM Original Price: 48eKD. Discounted price: 38eexD Please, enter ID of a car to view (or 999 to exit): 999 Student name: Abdullah al Abdullah, ID: 12345, Section: 01

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

MongoDB Applied Design Patterns Practical Use Cases With The Leading NoSQL Database

Authors: Rick Copeland

1st Edition

1449340040, 978-1449340049

More Books

Students also viewed these Databases questions