#i need help paraphrasing code before i can turn it in

6 messages · Page 1 of 1 (latest)

fallow pelican
#

#include <cstring>
#include <iostream>
using namespace std;

class Shape {
protected:
double width;

protected:
double height;

public:
void showDim() {
cout << "Width and height are " << width << " and " << height << endl;
}
};
class Triangle : public Shape {
public:
char style[20];
double area() { return width * height / 2; }
void showStyle() { cout << "Triangle is " << style << endl; }
};

hard houndBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

fallow pelican
#

i need help paraphrasing code before i can turn it in

#

#include <iostream>
using namespace std;
const float PI = 3.14;
class Shape {
float xC, yC;

public:
Shape(float xC, float yC);
void setx(float a) { xC = a; }
void sety(float b) { yC = b; }
float getx() { return xC; }
float gety() { return yC; }
void PrintCenter() { cout << xC << " " << yC << endl; }
};
class Circle : public Shape {
float r;

public:
Circle(float xCi, float yCi, float ra) {
setx(xCi);
sety(yCi);
r = ra;
};
float area() { return PI * r * r; }
};

void Main() {
Shape F(5, 2);
cout << F.getx() << " " << F.gety() << endl;
Circle C(20, 30, 7);
cout << C.getx() << " " << C.gety() << endl;
}

#

this is the second part if anyone can help

hard houndBOT
#

This question thread is being automatically closed. If your question is not answered feel free to bump the post or re-ask. Take a look at !howto ask for tips on improving your question.