Repository navigation
Expand file tree
/
Copy pathmain.cpp
More file actions
91 lines (67 loc) · 3.63 KB
/
Copy pathmain.cpp
File metadata and controls
91 lines (67 loc) · 3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include "Car.h"
#include "Sorting.h"
#include "Statistics.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <unordered_map>
using namespace std;
int main()
{
// -----------------------------------------------------------
// -------------- Read data from csv -------------------------
// -----------------------------------------------------------
string filename = "car_prices.csv";
vector<Car> cars = readDataFromFile(filename);
// -----------------------------------------------------------
// ------------- General Sorting testing ---------------------
// -----------------------------------------------------------
// cout << "Enter the header to sort the dataset (YEAR, MAKE, MODEL, TRIM, BODY, TRANSMISSION, VIN, STATE, CONDITION, ODOMETER, COLOR, INTERIOR, SELLER, MMR, SELLINGPRICE, SALEDATE, CONDITION_VALUE): ";
// string header;
// cin >> header;
// transform(header.begin(), header.end(), header.begin(), ::toupper);
// if (header == "YEAR" || header == "MMR" || header == "SELLINGPRICE" || header == "ODOMETER" || header == "CONDITION" || header == "CONDITION_VALUE") {
// mergeSortInteger(cars, header, 0, cars.size() - 1);
// } else {
// cars = mergeSortString(cars, header);
// }
// cout << "\nFirst 500 cars after sorting:\n";
// printFirst500Cars(cars);
// -----------------------------------------------------------
// ----------- Average selling price by year -----------------
// -----------------------------------------------------------
// cout << "\nAverage Selling Price by Year:\n";
// vector<YearData> averageByYear = calculateAverageByYear(cars);
// for (const YearData& data : averageByYear) {
// cout << "Year: " << data.year << ", Average Selling Price: $" << data.averageSellingPrice
// << ", Number of Cars: " << data.carCount << std::endl;
// }
// calculateTopCarsProportions(cars);
// map<string, pair<int, int>> regionTransmissionCounts = sortAndCountByRegionAndTransmission(cars);
// -----------------------------------------------------------
// ------------------ Condition Value ------------------------
// -----------------------------------------------------------
// cout << "\nCars sorted based on condition value:\n";
// printFirst500Cars(cars);
// calculateTopCarsProportions(cars);
// -----------------------------------------------------------
// ------------------ Best Selling Models --------------------
// -----------------------------------------------------------
// countBestSellingModelByMake(cars);
// -----------------------------------------------------------
// ------------------ Color Recognizer -----------------------
// -----------------------------------------------------------
// Color_recognizer(cars);
// Interior_recognizer(cars);
// -----------------------------------------------------------
// ------------------ Region wise Transmission----------------
// -----------------------------------------------------------
// sortAndCountByRegionAndTransmission(cars);
// -----------------------------------------------------------
// --------------- Average Price for At/MT Cars --------------
// -----------------------------------------------------------
// pair<float, float> averages = calculateAveragePriceByTransmission(cars);
// cout << "Average price for automatic transmission: $" << averagePrices.first << endl;
// cout << "Average price for manual transmission: $" << averagePrices.second << endl;
//countBestSellingModelByMake(cars);
}