Question
C++ Code Problem A: People and vehicles (20 points) For this part you will be keeping information on people and what cars they are driving.
C++ Code
Problem A: People and vehicles (20 points) For this part you will be keeping information on people and what cars they are driving. Your program should have the following options: p : create a new person in the database (you may assume this person's name is only one word) c : create a new car in the database (you may assume the car's name will be only one word) f : find and select a person in the database (if there is no such person, show no one) r : register the current person selected to a specified car (if there is no such car, they should be unregistered to any current cars) You may assume there will be no more than 100 cars in the database and no more than 100 people. If you try and find (and select) a person that doesn't exist, show no one for both the person and car. If a person is not registered to a car, show no one for the car. You may assume all people have different names and all cars have different names. However, a car and person might have the same name (see example 2). Each person can only be registered to a single car, but a car can have multiple people registered to it simultaneously (see example 3). Hint 1: use classes (and don't dump everything in a single function) Hint 2: use pointers (really!) or you might regret it when part B comes around Example 1 (user input underlined): Currently looking at: Person: No one In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit p What is this person's name? qinshu Currently looking at: Person: No one In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit c What is this car's name? putput Currently looking at: Person: No one In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit f Which person do you want to find? qinshu Currently looking at: Person: qinshu In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit r Which car do you wish to register this person to? putput Currently looking at: Person: qinshu In car: putput Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit r Which car do you wish to register this person to? mcstinks Currently looking at: Person: qinshu In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit f Which person do you want to find? ahmed Currently looking at: Person: No one In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit p What is this person's name? ahmed Currently looking at: Person: No one In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit f Which person do you want to find? ahmed Currently looking at: Person: ahmed In car: No one Do you want to: (p) make a new person, (c) make a new car, (f) find a person, (r) register a person to a car, or (q) quit q
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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