Help with vehicle registration console app

Hey thanks in advance to anyone who could lend a hand, im trying to get something together for a small security place, and we could really use some automated way to keep track of vehicles.

I was messing around on this website and I managed to put something together, my main issue now is having it save i guess.

Below is the code for entering in a new vehicle, I would like it to save to a custom file where the license plate will be the name of the file and the rest of the information will be stored in the file.

I.E; (A12SJF.txt)

My main reason for wanting it done like this, is because I also plan on having a lookup function where it will be able to open an individual file and return information from that rather than parse one big file.

Also I dont really claim to be very good at this so im also open to suggestions or examples on how to improve anything.

Thanks everyone

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
if (choice == "1" && userlogged == true)
	{
		string plate;
		string owner;
		string make;
		string model;
		string color;
		cout << "Enter the License Plate (No Spaces): ";
		getline (cin, plate);
		cout << "Enter the Owner(s) Name: ";
		getline (cin, owner);
		cout << "Enter the Make of the vehicle: ";
		getline (cin, make);
		cout << "Enter the Model of the vehicle: ";
		getline (cin, model);
		cout << "Enter the Color of the vehicle: ";
		getline (cin, color);
		cout << "Writing to file.\n";
		goto MainMenu;
	}
Last edited on
Topic archived. No new replies allowed.