/* I am new with vector arrays, This is basically a parking slot which can store 10 vehicles at a time. There are 2 classes, one named parking which stores the value, slot_number, availability which means slot is available or not, and vehicle_numbers. The second class vehicle has a vector array of type parking, now when a object of class is created all the slots are set to Available and now when we want to park a vehicle the values should change, I don't know what should be the function return type and argument, what should the function park_a_vehicle return and same what should be the arguments passed in main , I have commented 3 places as Code missing, please help as to what code should be inserted
using namespace std;
cout<<"\n Current Vehicle Status\n";
cout<<p->getslot_number()<<" "<<p->getavailability()<<" "<<p->getvehiclenumber();
park_a_vehicle() //1. Return type and parameter missing
// Code to be inserted
static int count=0;
cout<<"\n Please enter your vehicle number";
// 2. Code Missing as to what should be returned
cout<<"\n Please enter a choice";
cout<<"\n Press 1. to Display the Current Status";
cout<<"\n Press 2 to park a vehicle";
cout<<"\n Press 3 to exit";
cout<<"\n Your Choice: ";
park.park_a_vehicle(); // 3. Arguments Missing
cout<<"\n Wrong choice";
cout<<"\n Any more time you wanna enter (Y/N) ";
1. park_a_vehicle can be declared as type void since it doesn't need to return anything.
2. If declared void, nothing needs to be returned.
I think you need to reconsider your class structure. To me, your parking class represents a parking space within a parking lot which may or may not be occupied by a vehicle. It makes no sense to me to have each vehicle instance contain a vector of parking information. A "parking lot" is a vector of some number of parking spaces. vehicle_number should be an attribute of vehicle.
Some other errors:
Line 79: park_a_vehicle is called as a member function of park, but your park class has no such member function.
Line 113: display() is called as a member function of park, but your park class has no such member function.
The logic in your code is hard to understand (and the lack of code tags does not help).
What does a 'parking' represent?
What does a 'vechile' represent?
Then the std::vector<parking> veh;
A 'veh' is an array of 10 objects. Each object is a separate std::vector of parking objects. You are of course free to name classes as you wish, but I don't usually think that my (only) car has 42 parking slots, of which 7 are free.