Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Demonstrate knowledge in C++ Description 1. Design and implement a class with the following stipulations: a. The class will be of your own name and

Demonstrate knowledge in C++

Description

1. Design and implement a class with the following stipulations:

a. The class will be of your own name and design.

b. The class will reside inside its own header (.h) file.

c. The class must have at least three private member variables at least one of which shall be a std::string.

d. Provide a public constructor written such that all members are initialized with its initialization list.

e. Provide public get accessor functions for all of your members. f. Provide a public Copy Constructor.

g. Provide an overloaded operator<< for your type.

2. Inside of a .cpp file, do the following:

a. Include your header containing your class.

b. Write a main function that instantiates an object of your type, providing arguments for its constructor you wrote in (1.d).

c. Use the accessors (1.e) to output at least some of the members to std::cout just to check their values and correctness.

d. Instantiate another object using the copy constructor you wrote in (1.f) by passing in the first object you created in (2.b) as the argument.

e. Use the operator<< (1.g) to output both objects - they should output identical information.

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

Concepts Of Database Management

Authors: Joy L. Starks, Philip J. Pratt, Mary Z. Last

9th Edition

1337093424, 978-1337093422

Students also viewed these Databases questions