in this exercise you use the rectangle class from lab 15 2 to instantiate a rectangle object in the all around fence company program if necessary create a new project named intermediate 14 project copy the instructions from the lab15 2 rectangle h fil

//intermediate 13 recatangle.h

Create a class name recatangle

Save your time - order a paper!

Get your paper written from scratch within the tight deadline. Our service is a reliable solution to all your troubles. Place an order on any task and we will take care of it. You won’t have to worry about the quality and deadlines

Order Paper Now

//class declartion section

class rectangle

{

it has member data length and width

private:

double length; //member data

double width ; //member data

public

default constructor and member functions

rectangle ();//constructor

//member function that assigns values for member data

void setDimensions(double,double);

//memeber function that return Area

double calcArea();

//member function that returns Perimeter

int calcPerimeter();

};

//class implementation section

default constructor that initializes memeber data

rectangle ::setDeimensions(double len, double wid)// member function thtat assigns valuesfor

data members

{

if (len>0.0&&wid>0.0)

{

length =len;

width= wid

}

}

Member function definition that return Area

double Rectangke :: calcArea()

//Member Function that returns Area of the Rectangle object

{

return (int)(2*(length + width ));

}

//intermediate 13.cpp

/**************************************

program to calculate Perimeter and total fence cost of a rectangle yard

***************************************/

Include header files and intermediate 13 Rectangle.h file

#include //header file

#include //header file

#include // header file

#include “intermediate 13 rectangle.h”//class definition header file

using namespace std;

int main()

{

Declare variables

//variable declaration

double length,width

int perimeter

double fencecost, totalprice;

input yard length, yard width and fence cost per linear foot

cout<<“Enter Yard Length(in feet):”;

cin>>length;// input Yard Length

cout<<“nEnter Yard Wodth (in feet):”;

cin>> width; //Input yard Width

cout<<“nEnter Fence Cost (per linear foot ):”;

cin>> Fencecost ; //Input Fence cost per linear foot

Assign input values for length and width of the Rectangle //object

obj.setDimension(length,Width);

Calculate Perimeter of the rectangular Yard

//Calculate Perimeter of the Rectangle Object

Peromter = obj.calcPerimeter();

Calculate total cost of installing a fence

totalprice = fencecost*perimeter;

Dsisplay Perimter of the yard

// Display perimeter of the rectangular Yard

cout<< “nPerimeter of the fence:”<<perimeter

<<endl;

Display total Cost of installing a fence

//Display Total price: $”<<setprecision(2)<<fixed

<<totalprice<<endl;

system (“pause”);

}

I cant get it to work

 

Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount!
Use Discount Code “Newclient” for a 15% Discount!

NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post in this exercise you use the rectangle class from lab 15 2 to instantiate a rectangle object in the all around fence company program if necessary create a new project named intermediate 14 project copy the instructions from the lab15 2 rectangle h fil appeared first on My Nursing Experts.

 

“Are you looking for this answer? We can Help click Order Now”