+ 2
61.2 62.2 lessons for c# is not write the initial condition in code !
Please attention to moderators
10 Answers
0
Cool! 😅 but still strange
+ 2
In the innitial conditions to the issue says : there are declared clases
Opened the cod page I see nothing just main func
+ 2
Hmmm you click on a C# console ?
+ 2
Wow
I have reloaded the app and it works now 🙀 it was really strange
+ 2
abstract class Figure
{
//определите абстрактный метод Perimeter без фигуры
public abstract int Perimeter ();
}
class Rectangle : Figure
{
public int width;
public int height;
public Rectangle(int width, int height)
{
this.width = width;
this.height = height;
}
//определите абстрактный метод Perimeter для прямоугольника
public override int Perimeter()
{
return (2*this.width +2*this.heigth);
}
}
class Triangle : Figure
{
public int side1;
public int side2;
public int side3;
public Triangle(int s1, int s2, int s3)
{
this.side1 = s1;
this.side2 = s2;
this.side3 = s3;
}
//определите абстрактный метод Perimeter для треугольника
public override int Perimeter()
{
return (this.side1+this.side2+this.side3);
}
+ 1
What do you think is wrong there?
The moderators can't do anything about it. Please write to sololearn if you think there's a bug.
+ 1
Sounds strange... When I click it, I get the complete compilable code. 🤔
+ 1
And one more : 62.2 there is just one test and i do not see what is a misstake in my code 😿 nothing has been output on the console
+ 1
// рабочий код 100%
abstract class Figure
{
//определите абстрактный метод Perimeter без фигуры
public abstract int Perimeter ();
}
class Rectangle : Figure
{
public int width;
public int height;
public Rectangle(int width, int height)
{
this.width = width;
this.height = height;
}
//определите абстрактный метод Perimeter для прямоугольника
public override int Perimeter()
{
return (2*width + 2*height);
}
}
class Triangle : Figure
{
public int side1;
public int side2;
public int side3;
public Triangle(int s1, int s2, int s3)
{
this.side1 = s1;
this.side2 = s2;
this.side3 = s3;
}
//определите абстрактный метод Perimeter для треугольника
public override int Perimeter()
{
return (side1 + side2 + side3);
}
0
Seems to be a pro task, I can't access it. Could you please put your code in a playground script and summarize what the task is?