SlideShare una empresa de Scribd logo
1 de 3
HELPIDO.COM
CLICK HERE TO GET THE SOLUTION !!!!!!!!


COMP/220 iLab 7 of 7 - C++ Course

iLab 7 of 7: Polymorphism
iLAB OVERVIEW
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.


iLAB STEPS
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.


CLICK HERE TO GET THE SOLUTION !!!!!!!!

Más contenido relacionado

La actualidad más candente

Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDLAbd17m
 
9781111530532 ppt ch14
9781111530532 ppt ch149781111530532 ppt ch14
9781111530532 ppt ch14Terry Yoast
 
Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDLAbd17m
 
Class 4: Making Procedures
Class 4: Making ProceduresClass 4: Making Procedures
Class 4: Making ProceduresDavid Evans
 
11review(inheritance andpolymorphism)
11review(inheritance andpolymorphism)11review(inheritance andpolymorphism)
11review(inheritance andpolymorphism)IIUM
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Abdul Hannan
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaHamad Odhabi
 
Quiz2 cs141-1-17
Quiz2 cs141-1-17Quiz2 cs141-1-17
Quiz2 cs141-1-17Fahadaio
 

La actualidad más candente (18)

Functions
FunctionsFunctions
Functions
 
A08
A08A08
A08
 
Assignment 1
Assignment 1 Assignment 1
Assignment 1
 
CORE JAVA
CORE JAVACORE JAVA
CORE JAVA
 
Hemajava
HemajavaHemajava
Hemajava
 
Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDL
 
Thesis Talk
Thesis TalkThesis Talk
Thesis Talk
 
9781111530532 ppt ch14
9781111530532 ppt ch149781111530532 ppt ch14
9781111530532 ppt ch14
 
Model simulation VHDL
Model simulation VHDLModel simulation VHDL
Model simulation VHDL
 
Class 4: Making Procedures
Class 4: Making ProceduresClass 4: Making Procedures
Class 4: Making Procedures
 
11review(inheritance andpolymorphism)
11review(inheritance andpolymorphism)11review(inheritance andpolymorphism)
11review(inheritance andpolymorphism)
 
Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual Object Oriented Programming Lab Manual
Object Oriented Programming Lab Manual
 
Chapter 05
Chapter 05Chapter 05
Chapter 05
 
CIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in JavaCIS 1403 lab 3 functions and methods in Java
CIS 1403 lab 3 functions and methods in Java
 
Quiz2 cs141-1-17
Quiz2 cs141-1-17Quiz2 cs141-1-17
Quiz2 cs141-1-17
 
Chapter 03
Chapter 03Chapter 03
Chapter 03
 
Experiment 9(exceptions)
Experiment 9(exceptions)Experiment 9(exceptions)
Experiment 9(exceptions)
 
Presentation1
Presentation1Presentation1
Presentation1
 

Destacado

Student Information & Result Processing Sytem
Student Information & Result Processing SytemStudent Information & Result Processing Sytem
Student Information & Result Processing SytemMuslim U. Sumon
 
online examination management final presentation
online examination management final presentationonline examination management final presentation
online examination management final presentationluckymoni76
 
Online student portal
Online student portalOnline student portal
Online student portalZobia Zafar
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagementMickey
 
Student Management System Project Abstract
Student Management System Project AbstractStudent Management System Project Abstract
Student Management System Project AbstractUdhayyagethan Mano
 

Destacado (8)

Student Information & Result Processing Sytem
Student Information & Result Processing SytemStudent Information & Result Processing Sytem
Student Information & Result Processing Sytem
 
Notepad
NotepadNotepad
Notepad
 
Student information-result-system
Student information-result-systemStudent information-result-system
Student information-result-system
 
online examination management final presentation
online examination management final presentationonline examination management final presentation
online examination management final presentation
 
Online student portal
Online student portalOnline student portal
Online student portal
 
Abstract
AbstractAbstract
Abstract
 
Student result mamagement
Student result mamagementStudent result mamagement
Student result mamagement
 
Student Management System Project Abstract
Student Management System Project AbstractStudent Management System Project Abstract
Student Management System Project Abstract
 

Similar a Comp 220 ilab 7 of 7

Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7helpido9
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7ashhadiqbal
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesccis224477
 
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docx
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docxCSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docx
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docxfaithxdunce63732
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablescis247
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablessdjdskjd9097
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classsdjdskjd9097
 
Cis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classCis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classccis224477
 
Cis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classCis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classcis247
 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210Mahmoud Samir Fayed
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docxhoney725342
 
Question Bank DS
Question Bank DSQuestion Bank DS
Question Bank DSPRIANKA R
 
Prelim Project OOP
Prelim Project OOPPrelim Project OOP
Prelim Project OOPDwight Sabio
 
Cis 247 all i labs
Cis 247 all i labsCis 247 all i labs
Cis 247 all i labsccis224477
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classsdjdskjd9097
 
EN3085 Assessed Coursework 1 1. Create a class Complex .docx
EN3085 Assessed Coursework 1  1. Create a class Complex .docxEN3085 Assessed Coursework 1  1. Create a class Complex .docx
EN3085 Assessed Coursework 1 1. Create a class Complex .docxgidmanmary
 

Similar a Comp 220 ilab 7 of 7 (20)

Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7Comp 220 ilab 7 of 7
Comp 220 ilab 7 of 7
 
Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7Comp 220 ilab 6 of 7
Comp 220 ilab 6 of 7
 
Lecture 2 classes i
Lecture 2 classes iLecture 2 classes i
Lecture 2 classes i
 
17515
1751517515
17515
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
 
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docx
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docxCSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docx
CSC139 Chapter 10 Lab Assignment (2)PolymorphismObjectivesIn.docx
 
Cis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variablesCis247 a ilab 3 overloaded methods and static methods variables
Cis247 a ilab 3 overloaded methods and static methods variables
 
Cis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variablesCis247 i lab 3 overloaded methods and static methods variables
Cis247 i lab 3 overloaded methods and static methods variables
 
Java assgnmt2.
Java assgnmt2.Java assgnmt2.
Java assgnmt2.
 
Lab Manual-OOP.pdf
Lab Manual-OOP.pdfLab Manual-OOP.pdf
Lab Manual-OOP.pdf
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee class
 
Cis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classCis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee class
 
Cis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee classCis247 a ilab 2 of 7 employee class
Cis247 a ilab 2 of 7 employee class
 
The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210The Ring programming language version 1.9 book - Part 85 of 210
The Ring programming language version 1.9 book - Part 85 of 210
 
1 Project 2 Introduction - the SeaPort Project seri.docx
1  Project 2 Introduction - the SeaPort Project seri.docx1  Project 2 Introduction - the SeaPort Project seri.docx
1 Project 2 Introduction - the SeaPort Project seri.docx
 
Question Bank DS
Question Bank DSQuestion Bank DS
Question Bank DS
 
Prelim Project OOP
Prelim Project OOPPrelim Project OOP
Prelim Project OOP
 
Cis 247 all i labs
Cis 247 all i labsCis 247 all i labs
Cis 247 all i labs
 
Cis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee classCis247 i lab 2 of 7 employee class
Cis247 i lab 2 of 7 employee class
 
EN3085 Assessed Coursework 1 1. Create a class Complex .docx
EN3085 Assessed Coursework 1  1. Create a class Complex .docxEN3085 Assessed Coursework 1  1. Create a class Complex .docx
EN3085 Assessed Coursework 1 1. Create a class Complex .docx
 

Más de helpido6

Prg 421 week 4
Prg 421 week 4Prg 421 week 4
Prg 421 week 4helpido6
 
Prg 421 week 2
Prg 421 week 2Prg 421 week 2
Prg 421 week 2helpido6
 
Prg 421 week 1
Prg 421 week 1Prg 421 week 1
Prg 421 week 1helpido6
 
CIS/355 ilab 4 of 6
CIS/355 ilab 4 of 6CIS/355 ilab 4 of 6
CIS/355 ilab 4 of 6helpido6
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6helpido6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6helpido6
 
CIS/355 ilab 6 of 6
CIS/355 ilab 6 of 6CIS/355 ilab 6 of 6
CIS/355 ilab 6 of 6helpido6
 

Más de helpido6 (7)

Prg 421 week 4
Prg 421 week 4Prg 421 week 4
Prg 421 week 4
 
Prg 421 week 2
Prg 421 week 2Prg 421 week 2
Prg 421 week 2
 
Prg 421 week 1
Prg 421 week 1Prg 421 week 1
Prg 421 week 1
 
CIS/355 ilab 4 of 6
CIS/355 ilab 4 of 6CIS/355 ilab 4 of 6
CIS/355 ilab 4 of 6
 
Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6Cis 355 i lab 3 of 6
Cis 355 i lab 3 of 6
 
Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6Cis 355 i lab 1 of 6
Cis 355 i lab 1 of 6
 
CIS/355 ilab 6 of 6
CIS/355 ilab 6 of 6CIS/355 ilab 6 of 6
CIS/355 ilab 6 of 6
 

Último

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?XfilesPro
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Último (20)

08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?How to Remove Document Management Hurdles with X-Docs?
How to Remove Document Management Hurdles with X-Docs?
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

Comp 220 ilab 7 of 7

  • 1. HELPIDO.COM CLICK HERE TO GET THE SOLUTION !!!!!!!! COMP/220 iLab 7 of 7 - C++ Course iLab 7 of 7: Polymorphism iLAB OVERVIEW 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.
  • 2. 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. iLAB STEPS 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.
  • 3. 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. CLICK HERE TO GET THE SOLUTION !!!!!!!!