In: Computer Science
Explanation:
Here is the class UsedFurnitureItem with all the appropriate variables, getters , setters and constructors defined as mentioned above:
Code:
class UsedFurnitureItem
{
double age;
double brandNewPrice;
string description;
char condition;
double size;
double weight;
public:
UsedFurnitureItem()
{
age = 1.0;
brandNewPrice = 10.00;
description = "Not available";
condition = 'A';
size = 1.0;
weight = 1.0;
}
UsedFurnitureItem(double a, double b, string d, char c, double s,
double w)
{
age = a;
brandNewPrice = b;
description = d;
condition = c;
size = s;
weight = w;
}
double getAge()
{
return age;
}
double getBrandNewPrice()
{
return brandNewPrice;
}
string getDescription()
{
return description;
}
char getCondition()
{
return condition;
}
double getSize()
{
return size;
}
double getWeight()
{
return weight;
}
void setAge(double a)
{
if(a>0)
age = a;
}
void setBrandNewPrice(double b)
{
if(b>0)
brandNewPrice = b;
}
void setDescription(string d)
{
description = d;
}
void setCondition(char c)
{
if(c=='A' || c=='B' || c=='C')
condition = c;
}
void setSize(double s)
{
if (s>0)
size = s;
}
void setWeight(double w)
{
if (w>0)
weight = w;
}
};
PLEASE UPVOTE IF YOU FOUND THIS HELPFUL!