CSE 1320: Intermediate Programming Assignment 9 solution

$29.99

Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment

Description

5/5 - (10 votes)

This assignment focuses on binary trees.
Your code must compile without any warnings or errors and run without segmentation
faults to receive credit. Additionally, any allocated memory must be freed. Points will be
taken for inconsistent formatting.
1. A vehicle sales company has contracted you to create a sales calculator which suggests a vehicle given a customer’s budget. To maximize sales, the calculator should
suggest the two highest price items that fit their budget.
The program will be implemented using a Binary Search Tree.
Data Format
struct Car {
char *make;
char *model;
double price;
}
Requirements
• Accept a CSV file containing the manufacturer’s vehicle catalog. It is OK if
no CSV is given.
• Present a menu with options as shown in the example run. The user should
stay in the program until they choose to quit.
• Add functionality to add a model to the catalog.
• Add functionality to navigate through the catalog using depth first search such
that the models are displayed from highest price to lowest price.
• When printing out the list of vehicles, use a fixed width of 15 spaces for each
member.
• When adding a model, it should be inserted into the Binary Search Tree based
on the price.
• The struct declarations and all function declarations should be declared in a
header file with the same name as your C file. Be sure to use a header guard.
Example Run
CSE 1320: Assignment 9 Dillhoff
1. Suggest Vehicle
2. Add Model to Catalog
3. View Catalog
4. Exit
> 2
Enter make: Honda
Enter model: Civic
Enter price: 20000
1. Suggest Vehicle
2. Add Model to Catalog
3. View Catalog
4. Exit
> 1
Enter budget: 20000
MAKE MODEL PRICE
Honda Civic $20000
Toyota Yaris $15000
1. Suggest Vehicle
2. Add Model to Catalog
3. View Catalog
4. Exit
> 3
MAKE MODEL PRICE
Chevrolet Camaro $30000
Honda Civic $20000
Toyota Yaris $15000
1. Suggest Vehicle
2. Add Model to Catalog
3. View Catalog
4. Exit
> 4
Create a zip file using the name template LASTNAME_ID_A9.zip which includes the all
required code files. Submit the zip file through Canvas.
2