Write An Essay logo
  • Home
  • Dissertation Writing
  • Essay Writing
  • Personal Statement
  • My account
  • Order now
Order Now
Uncategorized

program design

2 min read
Posted on 
November 28th, 2021
Home Uncategorized program design

You are given a dataset about some all-wheel-drive cars and how much fuel they use. “I’m gonna attach it in excel because i cant attach a .cvs file but then i can send it in a zip file

Write a program to find the top 10 cars with highest city mpg. Write the results in the output file.
The input file is a CSV file with the following fields for each car:
Identification (String), Classification (String), Engine Type (String), Transmission (String), City
mpg(Integer), Fuel Type (String), Highway mpg(integer). Fields are separated by comma, with each car
on a separate line:

2009 Audi A4 Sedan 3.2, Automatic transmission, Audi 3.2L 6 cylinder 265hp 243ft-lbs, 6 Speed Automatic Select Shift, 17, Gasoline, 26
….

Classification: whether this is a “Manual transmission” or an “Automatic transmission”. If it is unknown,
it is left blank.
Identification: a unique ID for this particular car, using the year, make, model, and transmission type.

Example input/output:
Enter the file name: cars.csv
Output file name:
Top10_city_mpg.csv

Technical requirement:
1. Name your program cars_mpg.c.

2. The output files should be the named Top10_city_mpg.csv.

3. Assume that there are no more than 6000 cars in the file. Assume that each field is no more
than 150 characters.

4. Use fscanf and fprintf to read and write data. To read all fields of a car, use the following
conversion specifier for fscanf:
“%[^,], %[^,], %[^,], %[^,], %d, %[^,], %d\n“

 

5. The program should be built around an array of car structures, with each car containing
information of engine type, transmission, city mpg, fuel type, highway mpg, classification,
and identification.

6. Your program should include a function that sorts the cars by city mpg. You can use any
sorting algorithms such as selection sort and insertion sort. Note that with different sorting
algorithms, the result might differ when city mpg are the same.
void sort_city_mpg(struct car list[], int n);

7. Output file should be in the same format as the input file, with the members separated by
comma and each car on a separate line.

2012 Subaru Impreza Hatchback 2.0i, Manual transmission, Subaru 2.0L 4 Cylinder 148 hp 145 ft–lbs, 5 Speed Manual, 25,
Gasoline, 34
…..

attachment_1

Order an Essay Now & Get These Features For Free:

Turnitin Report

Formatting

Title Page

Citation

Outline

Place an Order
Share
Tweet
Share
Tweet
Calculate the price
Pages (275 words)
$0.00
Write An Essay
Company
  • Why Choose Us
  • About Us
  • Terms
  • Dissertation Help
  • Personal Statement
  • Research Paper Format
  • Term Papers
Legal
  • Write My Essay
  • Thesis Format
  • Custom Papers
  • Coursework Writing
  • Dissertation Writing
  • Essay Writing
How Our Service is Used:
Write An Essay essays are NOT intended to be forwarded as finalized work as it is only strictly meant to be used for research and study purposes. Write An Essay does not endorse or condone any type of plagiarism.
Subscribe
No Spam
© 2023 Write An Essay. All rights reserved.
Write An Essay will be listed as ‘Write An Essay’ on your bank statement.