Docsity

Overloaded Operators-Advanced Course on Programming-Assignment, Exercises of Advanced Computer Programming

Toggle sidebar
bg1
Programming
LabExercise 4
Dead Line: 23 March 11:00 AM.
Problem Statement:
In this assignment you have to extend the complex numbers class you studied in the lab.
Requirements:
Re implement the class, make all constructors, set and get functions.
• Overload the following operators:
o Arithmetic Operators (+, -, * /, %)
o Post/Pre Increment and Decrement Operators (++, --)
o Relational Operators (<, >, ==, !=, >=, <=)
o Assignment Operator ( = )
o Stream Insertion and Extraction Operators (<<, >>)
o And any other operators that you think are appropriate.
• All these operators should be overloaded not only for complex numbers as right
hand arguments but also for basic numeric types as right hand operators.
• Use all these operators.
• Make a function that returns how many complex numbers have been created so
far.
Submission Guidelines:
1. ZERO credit for assignments submitted after 23rd March 2008 11:00 AM..
2. Submit your assignment in groups of two. You have it submit it on your t.a’s email
address.
docsity.com

Partial preview of the text

Download Overloaded Operators-Advanced Course on Programming-Assignment and more Exercises Advanced Computer Programming in PDF only on Docsity!

Programming

LabExercise 4

Dead Line: 23 March 11:00 AM. Problem Statement: In this assignment you have to extend the complex numbers class you studied in the lab.

Requirements:

Re implement the class, make all constructors, set and get functions.

  • Overload the following operators: o Arithmetic Operators (+, -, * /, %) o Post/Pre Increment and Decrement Operators (++, --) o Relational Operators (<, >, ==, !=, >=, <=) o Assignment Operator ( = ) o Stream Insertion and Extraction Operators (<<, >>) o And any other operators that you think are appropriate.
  • All these operators should be overloaded not only for complex numbers as right hand arguments but also for basic numeric types as right hand operators.
  • Use all these operators.
  • Make a function that returns how many complex numbers have been created so far.

Submission Guidelines:

  1. ZERO credit for assignments submitted after 23rd^ March 2008 11:00 AM..
  2. Submit your assignment in groups of two. You have it submit it on your t.a’s email address.

docsity.com