Дописать программу на С++(консоль)
Создать новый класс Name_autor, который будет выводить на экран информацию об авторе программы. Производный класс должен наследовать два класса. Например: производный класс Rectangle должен наследовать данные и методы класса Point и Name_autor.
#include #include
#include
using namespace std;
void GoToXY (int column, int line)
{
COORD coord;
coord.X = column;
coord.Y = line;
HANDLE hConsole = GetStdHandle (STD_OUTPUT_HANDLE)
if (! SetConsoleCursorPosition (hConsole, coord)) {}
}
class Point {
protected:
int x, y;
public:
Point (): x (x), y (y) {}
Point (int x, int y) {
this-> x = x;
this-> y = y;
}
};
class Circle: public Point
{
public:
Circle (): Point (1, 1) {}
Circle (int x, int y): Point (x, y) {}
int n = 150;
void drawcirc () {
for (int i = 0; i
{
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
cout
GoToXY (x, ++ y)
Sleep (1000);
system ( "cls");
}
}
double r;
double Radius () {
double C, pi = 3.1415;
cout > C;
return r = C / (2 * pi)
}
void show () {
cout
}
};
int main () {
SetConsoleCP (1251) SetConsoleOutputCP (1251)
int o, x, y;
cout > x;
cout > y;
cout
вертикали \ n ";
cin >> o;
x = fabs (x)
y = fabs (y)
Circle circ (x, y)
if (o == 1) {
circ.Radius ();
circ.show ();
}
if (o == 2) {
circ.drawcirc ();
}