header not working pls help

i don't whats wrong i double check the the spelling and all it still wont compile please me.

here the main program
//Chl14LAb2.cpp
//calculates and display the cost of laying sod
//created/revised by <michelle roxas> on <9/18/2013>

# include <iostream>
# include <iomanip>
# include <"Rectangle.h"

using std::cout;
using std::cin;
using std::endl;
using std::fixed;
using std::setprecision;

int main()
{
//create Retangle object
Rectangle lawn;

//declare variables
double lawnLength = 0.0;
double lawnWidth = 0.0;
double priceSqyd =0.0;
double lawnArea = 0.0;
double totalPrice = 0.0;

//get length, width, and sod price
cout << "Lenth (in feet): ";
cin >> lawnLenght;
cout << "width (in feet): ";
cin >> lawnWidth;
cout << "Sod price (per square yard): ";
cin >> priceSqyd;

//assign input to Rectanglr object
lawn.setDimensions(lawnLength, lawnWidth);

//calculate area and total price
lawnArea = lawn.calcArea() 9.0;
totalPrice = lawnArea * priceSqyd;

//display area and total price
cout<< fixed << setprecision(2)<<endl;
cout <<"square yards: "<<lawnArea <<endl;
cout <<"Total price: $" << totalPrice <<endl;

return 0;
}//end of main function






and this is the header

//Rectangle.h
//declaration section

class Rectangle
{
public:
Rectangle();
void setDiemensions(double, double);
double calcArea();
double calcPerimeter();
private():
double length;
double width;
};

//implementation section
Rectangle::Rectangle()

{
length =0.0;
width = 0.0;
}// end of default constructor

void Rectangle::setDimensions(double len, double wid)
{
// assigns lenght and width tp private data members
if (len > 0.0 && wid > 0.0)
{
length =len;
width -wid;
} //end if
}//end of setDimensions method

double Rectangle::calcArea()
{
return length * width;
}//end of calcArea method
double Rectangle::calcPerimeter()

{
return (length + width) * 2.0;
}//end calcPerimeter method
Last edited on
# include <"Rectangle.h"

there's one clue.
i know its on the header, saying rectangle undeclare
you really need to read up on this stuff then mate.

remove the angle bracket and see what happens.
i just realize that cause i was getting frustrated, so i took it out and all this errors came out.
Last edited on
yea but I even gave you the line and you still couldnt fix it?
yah, i looked everyline that says whats wrong on it and still didn't work
1) Please use code tags when posting code, so that we can read it properly.

2) Just telling us "it won't compile" is useless. Tell us what the compiler errors are and what lines they occur on. You have this information, so why on earth would you withhold it from the people who you'd like to help you? It's like you don't want us to be able to find your problem!

3) Have you fixed the bad include statement that mutexe pointed out?
check your spelling of methods between the cpp and h file.

and some weird stuff like:
lawnArea = lawn.calcArea() 9.0;

width -wid;

etc etc
Last edited on
i have fix it thanks you guyz and also i learned how to use this easy way to read the code lol silly me

Topic archived. No new replies allowed.