The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 2 Days Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
Can some one help be construct this program,
Construct a class named Rectangle that has two double-precision data members named length and width.
The class should have the following class functions:
a)Â A constructor with the default values of 1Â for both length and width data members
b)Â An accessor function named showData() to set a rectangle's length and width
c) A mutator function named setData() to set the rectangle's length and width
d) A class function named perimeter() that calculates and displays the rectangle's perimeter
e) A class function named area() that calculates and displays the rectangle's area
Include the Rectangle class constructed in a working C++ program and exercise all functions.Â
Â
This is what i have so far,
#include "stdafx.h"
#include<iostream>
using namespace std;
class Rectangle
{
private:
double length;
double width;
Â
public:
Rectangle(double = 1, double = 1);
void SetData();
void perimeter();
void Area();
void ShowData();
----------- He-----------llo----------- Si-----------r/M-----------ada-----------m -----------Tha-----------nk -----------you----------- fo-----------r y-----------our----------- in-----------ter-----------est----------- an-----------d b-----------uyi-----------ng -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------. P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll -----------be -----------qui-----------ckl-----------y