Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use c++ All the questions are interlinked to one another. Please solve all the questions separately as given. Please use c++ language (20 pts.) 1.
use c++
All the questions are interlinked to one another.
Please solve all the questions separately as given. Please use c++ language
(20 pts.) 1. Define a class called Complex that will hold a real number and an ima gi ite protot a) default constructor b) overloaded constructor c) an overloaded + operator as a class member function d) an overloaded - operator as a class member function e) an overloaded cin function and types for the following member functions with labels for whic that will accept the real and imaginary parts of the number an overloaded cout function. (7 pts.) 2. Write code segments that will call all of the functions defined in #1. Label which function is being called. Make sure the code would compile. (30 pts.) 3. Using the class Complex defined in #1, write code outside the class definition for the following functions. Label the functions with the problem being coded. a) default constructor that sets real and imaginary to 0. b) overloaded constructor that will accept the real an imaginary parts of the number Use an intialization section to initialize the values. c) overloaded + operator and d) the overloaded cout function that prints the complex number as (a + bi) where a is the real portion and b is the imaginary part
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started