Answered step by step
Verified Expert Solution
Question
1 Approved Answer
can someone tell me why i keep getting these errors when i try to compare the ID number, make, model, and color of the car
can someone tell me why i keep getting these errors when i try to compare the ID number, make, model, and color of the car object inside my list container. Terminal Help File Edit View Search #include #include #include using namespace std; #ifndef CARS H #define CARS H class Car public: Car(); Car(int id, string make, string model, string color); int getID(); string getMake(); string getModel(); string getColor(); void setID(int id); void setMake(string make); void setModel (string model); void setColor(string color); private: int carID; string carMake; string carModel; string_carColor; dendir Terminal Help File Edit View Search #include #include #include "cars.h" using namespace std; #ifndef CONTAINER H #define CONTAINER H class Container public: Container(); Container(int capacity); Container(const Container& that); Container& operator=(const Container& that); -Container(); int size(); int capacity(); void add(Car num); void traverse(); Car get(int index); void set(int index, Car num); void add(int index, Car num); void del(int index); Car pop(); void push_back (Car num); private: Carpa; int size; int capacity: bool"isFull(); void doubleCapacity(); Vendif int main() ifstream inFile; Container container; int id; string make; string model; string color; string line; infile.open("cars.data"); if(infile.fail()) { cerr > choice; bool carFound = false; switch(choice) case 1: cout > id; for(int i = 0; i > make; for(int i = 0; i > model: for(int i 0; i > color; for(int 1.0; i > id: for(int i = 0; i > make; cout > model: cout > color: Car acar(id, make, model, color); container.add(acar); //container.add(Cardid, make, model, color)); addlewar.close(); break; case 6: cout > make; cout > model; cout > color; Car acar(id, make, model, color); container.add(acar); 1/container.add(Car(id, make, model, color)); addNewCar.close(); break; case 6: cout > id; for(int i 0; container.size(); 1) 1f(id - Car.getID)){ container.del(1); cout
can someone tell me why i keep getting these errors when i try to compare the ID number, make, model, and color of the car object inside my list container.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started