COMP220 Lab7 – Guaranteed 100% score

Lab Price = $8
Please feel free to send us your queries at: [email protected]
Payment Methods

Add to Cart

Buy Now

View Cart


Problem Statement

 

iLab 7 of 7: Polymorphism

i L A B O V E R V I E W
Scenario and Summary
This lab introduces students to the concepts of polymorphism, early binding, late binding, abstract classes, and virtual class functions. This will be done in the context of performing calculations on basic geometrical shapes. Polymorphism is a very powerful extension of inheritance, and by using pointers to the base class, it allows access to derived class objects and their functions based on the context that they are called in.
The lab will require the creation of a base geometric class, called Shape, and two sub classes, Circle and Rectangle, that are derived public from the class Shape. From there, objects of both the Circle and the Rectangle classes will be created, as will an array of pointers to the base class Shape. By using the instantiated objects and the object pointers, both static and dynamic binding will be demonstrated.

Deliverables
1. Submit a single NotePad file containing the source code for all the lab files to the Week 7 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.
2. Submit a lab report (a Word document) containing the following information to the Week 7 Dropbox.
o Include your name and the lab or lab exercise number.
o Specification: Include a brief description of what the program accomplishes, including its input, key processes, and output.
o 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.
o 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.
o A UML Diagram: This should show all the classes, class members, access specifiers, data types, and function arguments, along with all of the class-to-class relationships.
o Answers to Lab Questions: Include the answers to all the lab questions that are asked in the lab steps.
Each lab exercise should have a separate section in the lab-report document.
Your lab grade is based upon
1. the formatting of your source code;
2. the use of meaningful identifiers;
3. the extent of the internal documentation;
4. the degree to which an exercises’ specifications are met; and
5. the completeness of your lab report.

i L A B S T E P S
STEP 1: Create a New Multifile Project

Create a new multifile project with three classes: the base class Shape, the class Circle (derived public from Shape), and the class Rectangle (derived public from Shape). The classes will have the following requirements.
1. The class Shape should be an abstract class with the following pure virtual functions.
a. area()
b. perimeter()
2. The class Circle should be derived public from the class Shape and override both the area() and the perimeter() functions.
a. The perimeter() function should correctly calculate the circumference of a circle, given a radius.
b. The area() function should correctly calculate the area of a circle, given a radius
c. Include all the necessary accessor and mutator functions to accomplish the requirements of the class.
3. The class Rectangle should be derived public from the class Shape and override both the area() and the perimeter() functions.
a. The perimeter() function should correctly calculate the circumference of a rectangle, given its dimensions.
b. The area() function should correctly calculate the area of a rectangle, given its dimensions.
c. Include all the necessary accessor and mutator functions to accomplish the requirements of the class.
STEP 2: Create the Test Function

Instantiate at least one object of each of the Circle and the Rectangle classes. Provide appropriate constructors for both that will accept the necessary initialization arguments to provide the information required for all the class member functions. Exercise and test each member function of both classes for correct calculations and output.
STEP 3: Add a Base Class Pointer Array and an Additional Function

Add to the test function a base class array of pointers of the same dimension as the total number of Circle and Rectangle objects that were created in the previous step. Use this pointer array to access the Circle and the Rectangle objects to call a new, nonclass member function that will display all the information about each object.
1. Circle objects should display radius, circumference, and area.
2. Rectangle objects should display dimensions, perimeter. and area.
The information-display function should accept as its calling parameter a pointer of the class Shape.
Run the test function to demonstrate static (early) binding using the derived class objects calling their member functions, and run the test function to demonstrate dynamic (late) binding using the assigned Shape class pointers to call the nonclass, member-display-information function.

Relevant Material
Screenshots

 

COMP220 Lab7 UML DIagram
COMP220 Lab7 UML Diagram

COMP220 Lab7 Output
COMP220 Lab7 Output
Instructions
* If you want to purchase multiple products then click on “Buy Now” button which will give you ADD TO CART option.Please note that the payment is done through PayPal.
* You can also use 2CO option if you want to purchase through Credit Cards/Paypal but make sure you put the correct billing information otherwise you wont be able to receive any download link.
* Your paypal has to be pre-loaded in order to complete the purchase or otherwise please discuss it with us at [email protected].
* As soon as the payment is received, download link of the solution will automatically be sent to the address used in selected payment method.
* Please check your junk mails as the download link email might go there and please be patient for the download link email. Sometimes, due to server congestion, you may receive download link with a delay.
* All the contents are compressed in one zip folder.
* In case if you get stuck at any point during the payment process, please immediately contact us at [email protected] and we will fix it with you.
* We try our best to reach back to you on immediate basis. However, please wait for atleast 8 hours for a response from our side. Afterall, we are humans.
* Comments/Feedbacks are truely welcomed and there might be some incentives for you for the next lab/quiz/assignment.
* In case of any query, please donot hesitate to contact us at [email protected].
* MOST IMPORTANT Please use the tutorials as a guide and they need NOT to be used for any submission. Just take help from the material.
******************************************** Good Luck ***************************************************
Payment Details

 

Lab Price = $8
Please feel free to send us your queries at: [email protected]
Payment Methods

Add to Cart

Buy Now

View Cart

Privacy Policy
We take your privacy seriously and will take all measures to protect your personal information.
Any personal information received will only be used to fill your order. We will not sell or redistribute your information to anyone.
Refund Policy
Incase you face any issues with the tutorial, please free to contact us on [email protected]
We will try our best to resolve the issue and if still persists we can discuss for a refund in case its required.


Leave a Reply