Hi everyone ,i have a problem programming this project. ill be very thankful if u help me solve it ..the project info:
in this project you are required to design and build the flight reservation sub system. In the flight reservation sub system users can search for a flight and determine the total cost of a flight then choose to book that flight or not. Total cost of the flight depends on many factors for example: the departure and arrival airports, number of passengers and whether Adult or child, type of the trip whether it is one way or round trip. Next I will describe the system specifications that you need to consider when you build the system.
The reservation system is designed to serve three types of users: first, unregistered users who can search for a flight, register in the system. Your system should not keep any information about unregistered users.
Second, unregistered user can register in the system and become a registered user. Registered users should be able to login to the system, search for flight, book flights, cancel flights, show details of reserved flights, view and update personal profile information and finally logout from the system. Unlike unregistered users, the system need to keep information about registered users in order to identify them later. The system should keep the following information about any registered user: email, password, first name, last name, country of residence, date of birth and balance.
Finally, the administrators who are responsible to keep the system updated with the last information of existing planes in the system and flights information. The administrators should be able to login to the system, add new planes to the system, add new flights to the system, display flights arrived or departed at certain day, view all passengers in any flight and their seat numbers and logout from the system.
In the flight reservation system user should be able to search for all available flights that meets his requirements and then book a flight according to his preferred duration and cost. The user should determine the following when he is searching for a flight: departure date, time and airport, arrival date, time and airports for round trip flight, whether he want to travel on economy class or business class, whether the trip is one-way or a round trip and number and type (child or adult) of passengers. The system then shows all flights that meets his search criteria's. The user after that book his preferred flight by determine its number. For every flight the system should keep information about the passengers plane like its number, model and maximum seats capacity, number of seats in business class and economy class in order to make it easy to determine the availability of seats in any flight.
So, what did you do?
What problem did you encounter?
What does your design look like?
Where is your code?
What did the compiler say when you compiled it?
yah ...sorry i had to be more specific in my question ! i face a prob determining the num of classes for this program ! and how can i make the lists in it?! array or linked list?!
OP: reading through your assignment these are the classes and some of their methods and members that I could discern, see if they're of any use or not:
i face a prob determining the num of classes for this program ! and how can i make the lists in it?! array or linked list?!
your choice would depend on what you need to do - do you need to insert flights / planes / users at specific points of their chain - in that case std::list would be better, if you can keep them together and access any of them directly then C-style array, std::array or std::vector might be more suitable. Here's a link to the standard library containers and a flowchart to determine when to use which one of them: http://homepages.e3.net.nz/~djm/cppcontainers.html
The link is slightly dated in that it refers to some of the unordered containers as hash ... but the container choosing flowchart is still quite useful
thank u so much ! tht was so useful! but can i ask about how to explain and define the inherited and the main classes in my prog ?!
and can i make an array to display the num of planes in it for example ?! and how will i make the admin login and chane this number?!
sorry; but im a beginner in c++ and i still facing so many problems using it...
how to explain and define the inherited and the main classes in my prog ?!
A Flight has a Plane, so I'd suggest class Flight takes a Plane data-member _itsPlane (this is called containment when a class has an object of another class)
In your program can non-registered users book flights (as some websites allow) or do they have to register before then can move on to booking the actual flight? In either case I was thinking of something on these lines:
class Passenger : public UnRegUser, public RegUser { ... }; and then class Flight could have another data-member vector<Passenger> _itsPassengers which holds all the passenger info. If UnRegUser needs to register first before booking flights then Passenger can inherit from RegUser solely
class Administrator needs extensive access to class Plane and class Flight and so could be a friend of both these classes
The main() program would start off as a menu such as
And then depending on the choice it would branch out into further sub-menus and so on.
can i make an array to display the num of planes in it for example
you certainly can but how is the plane information getting to the program? Is there a list of planes, in a .txt file for eg, that needs to be read off into an array or vector or are these to be entered by hand. Whatever the case might be you just need to overload the insertion operator << (and extraction operator >> if reading from .txt file) for class Plane and then apply it to the container holding information about the planes. To print out flights, passengers readily you may wish to consider similar overloads for these classes as well