Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++ ***This program is about operator overloading in inheritance hierarchies. *** This term, the key idea is to break down the problem outlined (below) into

C++

***This program is about operator overloading in inheritance hierarchies. *** This term, the key idea is to break down the problem outlined (below) into small pieces and assign those responsibilities to individual classes. For each assignment, your job will be to create an OO design and program that shows how Object Oriented constructs could be used to solve the problem. You will want to focus on how to design classes that are well structured, efficient, that work together, and where each class has a specific job. This time you are adding operator overloading as the new syntax for your solution!

So how do you communicate with your friends? Is it by phone calls, text or other instant messaging services, facebook messenger, or maybe even email? If you use multiple services, do you ever get tired of checking each or wondering for this particular friend how best should I communicate with them. I might text someone who uses facebook rather than texts.

Your mission, if you choose to take it, is to create a small application that keeps track of messages from at least 3 different vehicles (e.g., text, facebook, email). You want people to quickly know when they have a message from one of these services. Create a contacts list where each person not only has a name, they also have a tag for how best to communicate with them. Based on that tag, the contacts will have their phone number, facebook account name, or email address, etc. Allow people to read, send and receive messages. THIS IS A SIMULATION, so it is not expected that you actually interact with facebook or other applications. As usual, you need a minimum of 5 classes, some hierarchically arranged.

Data structure:

The application will store messages using a balanced binary search tree of your choice (e.g., 2-3, 2-3-4, read-black, AVL, or others). You may use a combination of a standard BST and an array to create a balanced BST. STL containers are acceptable too.

The primary purpose is to support operators with your classes: =, +, +=, ==, !=, the relational operators, and the ability to input/output data. Think about how these operators might apply to your classes. You could apply them to a message class or to your tree class (or both). Will you use the + to append to a message? Certainly << will allow you to display or send a message. The = operator will allow a message to be copied. As you decide how to apply the operators, make sure to stay within the rules of how the operators are expected to behave. You may find that some operators dont apply at all (and therefore shouldnt be implemented). Dont forget your copy constructor! For each of your operators make sure to fully test them.

In fact, EVERY CLASS that has dynamic memory MUST have a copy constructor AND an assignment operator to perform a deep copy!

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

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

How do you add two harmonic motions having different frequencies?

Answered: 1 week ago

Question

Explain what is meant by the terms unitarism and pluralism.

Answered: 1 week ago