Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I really need help with this C++ program, and to not just copy the code from another answer to this question. I really need for

I really need help with this C++ program, and to not just copy the code from another answer to this question. I really need for the code to match the sample output exactly as it is. Please help. Every time I ask this question, they give me the same code and it doesn't work.

Implement a class Person with two attributes name and age , and a class Car with three fields:

the model

a pointer to the owner (a Person*)

a pointer to driver (also a Person*)

The class Person must have a function called incrementAge. The function increments the age by one. Also Create a function to find a person with the given name in an array of Person* pointer.

/** @param a the array @param n the name to look for @return the first matching Person* or NULL if there is no match */

Person* find(vector a, string n)

Write a program that prompts the user to specify people and cars. Store them in a vector and a vector

Output sample

Enter name, q to quit: John Nguyen Enter age: 30 Enter name, q to quit: Ralph Bravaco Enter age: 50 Enter name, q to quit: q Enter model, q to quit: Tesla model S Enter owner name: John Nguyen Enter driver name: Sahi Simonson Enter model, q to quit: Tesla model X Enter owner name: Timonthy Budd Enter driver name: John Nguyen Enter model, q to quit: q Car model: Tesla model S,owner=John Nguyen,age=31,driver=NULL. Car model: Tesla model X,owner=NULL,driver=John Nguyen,age=31.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What is management growth? What are its factors

Answered: 1 week ago

Question

What is DDL?

Answered: 1 week ago