Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

writing a C++ program based on Object Oriented Programming as outlined below. Each Print function should print the class name and the datatype of parameter.

writing a C++ program based on Object Oriented Programming as outlined below.

Each Print function should print the class name and the datatype of parameter.

In the OutStream: Char Print function: x

In the SubOutStream: Char Print function: x

A superclass called OutStream with the following member functions that are

virtual void print(char value) = 0 // prints a char value and OutStream

virtual void print(int value) {...} // prints an int value and OutStream

virtual void print(short value) {...} // prints a short and OutStream

void print(long value) {...} // prints a long value and OutStream

A subclass called SubOutStream that inherits the OutStream class. Its member function must include:

void print(char value) {...} // prints a char value and SubOutStream

void print(short value) {...} // prints a short and SubOutStream

void print(long value) {...} // prints a long value and SubOutStream

void print(float value) {...} // prints an float value and SubOutStream

void print(double value) {...} // prints an double value and SubOutStream

Test your program with your own data, but you must implement and successfully test the two classes using the polymorphism types. Create example in main to test each type of casting below.

Hint: Using Pointers

Class Implicit Casting

Class Implicit Casting with Dynamic Objects

Class Explicit Casting

Class Explicit Casting with Dynamic Objects

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

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions