Schedule‎ > ‎

CS-11 Final Exam starter code

car.h starter code:


#include <cstdlib>
#include <climits>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <vector>
using namespace std;

class Car {
public:

private:
    string _makemodel;
    int _year;
    double _price;
    int _quantity;
};

cardb.txt


Rolls-Royce
1976
21900.52
1
Toyota Camry
2018
23495.50
2
VW Passat
2016
20234.99
2

Makefile:
Remember that you have to have tabs (not spaces) in your Makefile

# define target dependencies and files
carapp: carapp.o car.o
g++ -o carapp carapp.o car.o

# define how each object file is to be built
carapp.o: carapp.cpp car.h
g++ -c carapp.cpp -Wall -Wextra -Wpedantic -std=c++11  

car.o: car.cpp car.h
g++ -c car.cpp -Wall -Wextra -Wpedantic -std=c++11 

# clean up
clean:
rm -f carapp.exe *.o

Comments