SlideShare a Scribd company logo
1 of 1
Download to read offline
In this lab you will develop a program to test a Rectangle class.: Following files will be needed. 1.
Rectangle.h This will define a Rectangle class. The class definition includes a. Two private float
variables for storing length and width b. A constructor that takes two parameters one for initializing
the length and other for initializing the width c. Mutator and Accessor method for length and width
variables d. And following four methods e. float getArea(); f. float getPerimeter(); g. void display (;
h. void operator=-(Rectangle rect 2 ); This is an operator overloading function You can use inline
definitions for functions needed for parts b and c but functions in parts e to h must be declared as
public functions. 2. Rectangle.cpp This file must contain the body of public class functions and
must include Rectangle.h 3. RectangleTest.cpp 1. Ask the user lengths and widths of two
rectangles. 2. Using that information to create two Rectangle objects 3. Call display function of
both rectangles 4. Call the = overloaded function. Some simple runs of the program are as follows:
Please enter length of flist Rectangle : 4 Please enter width of flrst Rectangle : 5 Please enter
length of second Rectangle : 2 Please enter width of second Rectangle : 10 Rectangle 1 's
tnformation Length =4 width=5 Area=20 Perineter=18 Rectangle 1 's information Length =2
width=10 Area=20 Perlneter=24

More Related Content

Similar to In this lab you will develop a program to test a Rectangle c.pdf

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
honey725342
 
Chapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-classChapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-class
Deepak Singh
 
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docxECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
jack60216
 

Similar to In this lab you will develop a program to test a Rectangle c.pdf (20)

Bc0037
Bc0037Bc0037
Bc0037
 
C++ tutorials
C++ tutorialsC++ tutorials
C++ tutorials
 
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
 
2nd puc computer science chapter 8 function overloading
 2nd puc computer science chapter 8   function overloading 2nd puc computer science chapter 8   function overloading
2nd puc computer science chapter 8 function overloading
 
Data structure week 1
Data structure week 1Data structure week 1
Data structure week 1
 
Storage class
Storage classStorage class
Storage class
 
Review constdestr
Review constdestrReview constdestr
Review constdestr
 
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
 
3d7b7 session4 c++
3d7b7 session4 c++3d7b7 session4 c++
3d7b7 session4 c++
 
Presentation on Function in C Programming
Presentation on Function in C ProgrammingPresentation on Function in C Programming
Presentation on Function in C Programming
 
Functions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptxFunctions IN CPROGRAMMING OF ENGINEERING.pptx
Functions IN CPROGRAMMING OF ENGINEERING.pptx
 
cprogramming questions for practice end term
cprogramming questions for practice end termcprogramming questions for practice end term
cprogramming questions for practice end term
 
Chapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-classChapter27 polymorphism-virtual-function-abstract-class
Chapter27 polymorphism-virtual-function-abstract-class
 
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docxECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
ECS 40 Program #3 (50 points, my time 1.5 hours) Spring 2015 .docx
 
C language 3
C language 3C language 3
C language 3
 
The smartpath information systems c pro
The smartpath information systems c proThe smartpath information systems c pro
The smartpath information systems c pro
 
Functions in c
Functions in cFunctions in c
Functions in c
 
arrays.ppt
arrays.pptarrays.ppt
arrays.ppt
 
C++ Constructs.pptx
C++ Constructs.pptxC++ Constructs.pptx
C++ Constructs.pptx
 
C Languages FAQ's
C Languages FAQ'sC Languages FAQ's
C Languages FAQ's
 

More from spsvirdi

in this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdfin this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdf
spsvirdi
 
In the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdfIn the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdf
spsvirdi
 

More from spsvirdi (18)

In what ways did the evolution of an exoskeleton help insect.pdf
In what ways did the evolution of an exoskeleton help insect.pdfIn what ways did the evolution of an exoskeleton help insect.pdf
In what ways did the evolution of an exoskeleton help insect.pdf
 
In which external environments do changes usually occur mo.pdf
In which external environments do changes usually occur mo.pdfIn which external environments do changes usually occur mo.pdf
In which external environments do changes usually occur mo.pdf
 
In this era of tough economic conditions voters increasingl.pdf
In this era of tough economic conditions voters increasingl.pdfIn this era of tough economic conditions voters increasingl.pdf
In this era of tough economic conditions voters increasingl.pdf
 
In user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdfIn user interface design what is typically TRUE Group of a.pdf
In user interface design what is typically TRUE Group of a.pdf
 
In week 23 and 4 we will look at travel trade from the pers.pdf
In week 23 and 4 we will look at travel trade from the pers.pdfIn week 23 and 4 we will look at travel trade from the pers.pdf
In week 23 and 4 we will look at travel trade from the pers.pdf
 
In use cases an association aka communication relationshi.pdf
In use cases an association aka communication relationshi.pdfIn use cases an association aka communication relationshi.pdf
In use cases an association aka communication relationshi.pdf
 
In use cases an inheritance relationship is A relationship .pdf
In use cases an inheritance relationship is A relationship .pdfIn use cases an inheritance relationship is A relationship .pdf
In use cases an inheritance relationship is A relationship .pdf
 
In their article summarizing how one company rooted out bias.pdf
In their article summarizing how one company rooted out bias.pdfIn their article summarizing how one company rooted out bias.pdf
In their article summarizing how one company rooted out bias.pdf
 
In Unit Seven the Redfield ratio is defined Based on this .pdf
In Unit Seven the Redfield ratio is defined Based on this .pdfIn Unit Seven the Redfield ratio is defined Based on this .pdf
In Unit Seven the Redfield ratio is defined Based on this .pdf
 
in this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdfin this case we chose the best option would be to work with .pdf
in this case we chose the best option would be to work with .pdf
 
In the United States in 2017 approximately what percentage .pdf
In the United States in 2017 approximately what percentage .pdfIn the United States in 2017 approximately what percentage .pdf
In the United States in 2017 approximately what percentage .pdf
 
In the video Bob Williams talks about setting up a factory .pdf
In the video Bob Williams talks about setting up a factory .pdfIn the video Bob Williams talks about setting up a factory .pdf
In the video Bob Williams talks about setting up a factory .pdf
 
In this discussion reflect on the head of the IT department.pdf
In this discussion reflect on the head of the IT department.pdfIn this discussion reflect on the head of the IT department.pdf
In this discussion reflect on the head of the IT department.pdf
 
In the ZW sexdetermination system for birds males ZZ are.pdf
In the ZW sexdetermination system for birds males ZZ are.pdfIn the ZW sexdetermination system for birds males ZZ are.pdf
In the ZW sexdetermination system for birds males ZZ are.pdf
 
In the Stanford Journal of law Businessamp Finance expla.pdf
In the Stanford Journal of law Businessamp Finance expla.pdfIn the Stanford Journal of law Businessamp Finance expla.pdf
In the Stanford Journal of law Businessamp Finance expla.pdf
 
In the vertebrate brain each region is specialized in funct.pdf
In the vertebrate brain each region is specialized in funct.pdfIn the vertebrate brain each region is specialized in funct.pdf
In the vertebrate brain each region is specialized in funct.pdf
 
In the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdfIn the Solutions column identify as a team possible solut.pdf
In the Solutions column identify as a team possible solut.pdf
 
In the tugofwar for policy attention elected officials of.pdf
In the tugofwar for policy attention elected officials of.pdfIn the tugofwar for policy attention elected officials of.pdf
In the tugofwar for policy attention elected officials of.pdf
 

Recently uploaded

Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 

In this lab you will develop a program to test a Rectangle c.pdf

  • 1. In this lab you will develop a program to test a Rectangle class.: Following files will be needed. 1. Rectangle.h This will define a Rectangle class. The class definition includes a. Two private float variables for storing length and width b. A constructor that takes two parameters one for initializing the length and other for initializing the width c. Mutator and Accessor method for length and width variables d. And following four methods e. float getArea(); f. float getPerimeter(); g. void display (; h. void operator=-(Rectangle rect 2 ); This is an operator overloading function You can use inline definitions for functions needed for parts b and c but functions in parts e to h must be declared as public functions. 2. Rectangle.cpp This file must contain the body of public class functions and must include Rectangle.h 3. RectangleTest.cpp 1. Ask the user lengths and widths of two rectangles. 2. Using that information to create two Rectangle objects 3. Call display function of both rectangles 4. Call the = overloaded function. Some simple runs of the program are as follows: Please enter length of flist Rectangle : 4 Please enter width of flrst Rectangle : 5 Please enter length of second Rectangle : 2 Please enter width of second Rectangle : 10 Rectangle 1 's tnformation Length =4 width=5 Area=20 Perineter=18 Rectangle 1 's information Length =2 width=10 Area=20 Perlneter=24