Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSC 330 Object Oriented Software Design Labl Create a class Complex having two private data members real and imag of type double. The declaration of

image text in transcribed
CSC 330 Object Oriented Software Design Labl Create a class Complex having two private data members real and imag of type double. The declaration of your class (.h file) should include into the public section the prototypes of two constructors (default non- parameterized and constructor initializer), as well as the following member functions getReal, getlmag, setReal, setlmag, addComplex, subtractComplex, multiplyComplex and print. The last one displays the values stored into the private data members. Additional Requirements: 1. Use minimum number of formal parameters. 2. For the definition of the constructor initializer use the initialization list. 3. For the definitions of addComplex, subtractComplex and multiplyComplex use pointer this. 4. No cin, cout in class methods except in function print. 5. No friend functions. Write a driver (epp) program to test all of the above functions. Submit printout of your source code and your outputs. NOTE: You should create three separate files h file for class declaration; .cpp file for member function definitions and epp file for driver program). What to submit: 1. Upload a zip file on the blackboar d which contains your code (do not forget comments) and your output. 2. Additionally submit a printout of your code and your output. Do not forget to include the following two lines before your code: II CSC 330 Labl II Your Name Submissions after the due date will be penalized. No submissions will be accepted one week after the due date

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

Fundamentals Of Database Management Systems

Authors: Mark L. Gillenson

3rd Edition

978-1119907466

More Books

Students also viewed these Databases questions