Posts

Showing posts with the label array

Using a CSV file from C++ program | Flight booking system

Image
Using a CSV file to store data from a C++ program I used objects to store each flight's data in a previous project. This made the program hold the data in the random access memory. This can pose a problem as it is not a permanent way of storing the data and will be erased once the program ends. To counter this, I initially thought of using a database with C++. I sought help with this online and was told about using a CSV file before using a database. A CSV file is a file format that stands for Comma Separated Values. This file can be used to represent rows in the form of lines and column data as values in each line that lie in the same position in their respective line. This way CSV files can be used to represent tabular data. Having said all that, we should look at how we can create a CSV file. Creating a CSV file There are two ways of creating a CSV file. You can either use a text editor such as Notepad in Windows, or you can use a sheets application such as MS Excel in Windows. ...

Flight booking system in C++

Image
 Flight booking system using class in C++ The concept of class is best illustrated by using it to build functional systems. A class is a template according to which objects can be created. A class can have data members and member functions. The data members can contain useful information and data specific to an object. A member function can be used for multiple purposes. These purposes include manipulating data members, performing various routines defined by the programmer, etc. Note: The string.h has been used in this program to perform operations on strings. #include <iostream> #include <string.h> //for operations on string using namespace std; How would this system work? credit - https://pixabay.com/users/wal_172619-12138562/   A flight booking system entails the user choosing between different flights based on their preferences (departure location, destination, time, day, etc). A flight class is used to create ...