Question: Hii so just found this test code and I'm trying to test run it but it says fatal error (no such file or directory) What
Hii so just found this test code and I'm trying to test run it but it says fatal error (no such file or directory) What should I do?
Code and screenshot at the bottom. Thanks!...
Rectangle.h
#ifndef RECTANGLE_H_ #define RECTANGLE_H_ // Rectangle class declaration. class Rectangle { private:
double width;
double length;
public:
void setWidth(double);
void setLength(double);
double getWidth() const;
double getLength() const;
double getArea() const;
};
#endif /* RECTANGLE_H_ */
Rectangle.cpp
#include "Rectangle.h" //**************************************************
// setWidth assigns a value to the width member. *
//**************************************************
void Rectangle::setWidth(double w)
{
width = w;
}
//**************************************************
// setLength assigns a value to the length member. *
//**************************************************
void Rectangle::setLength(double len)
{
length = len;
}
//**************************************************
// getWidth returns the value in the width member. *
//**************************************************
double Rectangle::getWidth() const
{
return width;
}
//****************************************************
// getLength returns the value in the length member. *
//****************************************************
double Rectangle::getLength() const
{
return length;
}
//*****************************************************
// getArea returns the product of width times length. *
//*****************************************************
double Rectangle::getArea() const
{
return width * length;
}
main.cpp
#include
//***************************************************** // Function main * //*****************************************************
int main() { double number; unique_ptr // Get the kitchen dimensions. cout > number; // Get the length rect->setLength(number); // Store in kitchen object cout > number; // Get the width rect->setWidth(number); // Store in kitchen object cout getWidth()getLength()getArea() return 0; } 
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
