15b_Assignment_7

15b_Assignment_7 - Assignment 7 - Operator Overloading...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Assignment 7 - Operator Overloading Select one option from the several below. All options are worth the same number of points. The more advanced options are provided for students who find the basic ones too easy and want more of a challenge. Make sure you have read and understand the Modules Information About Programming Assignments and Style Rules for Assignments before submitting this assignment. Hand in only one program, please. OPTION A (Basic): Complex Numbers Create a class of Complex numbers . The private data should be: double real, double imag - These two doubles define the Complex number and are called the real and imaginary parts. Think of each Complex number as an ordered pair, (r,i) of doubles . Besides the usual constructors and accessor/mutators, provide four overloaded operators , +, -, * and / . Implement these operators as friend methods of the class, so that Complex objects can be combined using these four operations. Also, allow a mixed mode operation containing a
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 2

15b_Assignment_7 - Assignment 7 - Operator Overloading...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online