COMP 220 iLab 6 of 7: Overloaded Operators

COMP 220 iLab 6 of 7: Overloaded Operators

Scenario and Summary
This lab is to introduce students to the concept of operator overloading as member functions of a class. This will be done in the context of creating a class that will perform four basic mathematical operations on complex numbers.
The C++ compiler has defined operators for all the arithmetic and assignment operations for its native data types, such as integer, float, double, and so forth. However, for user-defined data types, such as classes and structures, these operations are undefined.
C++ allows the programmer to create new definitions for these operators so that they can operate specifically on these user-defined data types. Which set of operators is actually called and implemented is decided during the compilation, and it is based on the data types of the operands involved in the operation.
The ability to define a new set of data-type, dependent operations on existing operators, or functions, is called operator overloading.

Deliverables

Submit a single Notepad file containing the source code for all files of the lab to the Week 5 Dropbox. Your source code should use proper indentation and be error free. Be sure that your last name and the lab number are part of the file name: for example, YourLastName_Lab5.txt.

Each program should include a comment section that includes, at a minimum, your name, the lab and exercise number, and a description of what the program accomplishes.
Submit a lab report (a Word document) containing the following information to the Week 6 Dropbox.
Include your name and the lab or lab exercise number.
Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.
Test Plan: Include a brief description of the method you used to confirm that your program worked properly. If necessary, include a clearly labeled table with test cases, predicted results, and actual results.
Summary and Conclusions: Write a statement summarizing your predicted and actual output, and identify and explain any differences. For conclusions, write at least one nontrivial paragraph that explains, in detail, either a significant problem you had and how you solved it or, if you had no significant problems, something you learned by doing the exercise.
A UML diagram: This should show all the classes, class members, access specifiers, data types, and function arguments, along with any and all class-to-class relationships.
Answers to Lab Questions: Include the answers to any and all lab questions asked in the lab steps.

Use the order calculator below and get started! Contact our live support team for any assistance or inquiry.

[order_calculator]