update
This commit is contained in:
@@ -7,11 +7,20 @@ using System.Threading.Tasks;
|
||||
namespace Negyszog {
|
||||
public class Negyszog {
|
||||
public double oldal { get; set; }
|
||||
public double oszlop;
|
||||
|
||||
public Negyszog(double oldal) {
|
||||
this.oldal = oldal;
|
||||
}
|
||||
|
||||
public void getOszlop(double oszlop) {
|
||||
if(oszlop <= 0) {
|
||||
throw new ArgumentException("A magasság negativ!");
|
||||
} else {
|
||||
this.oszlop = oszlop;
|
||||
}
|
||||
}
|
||||
|
||||
public double Kerulet() {
|
||||
return 4.0 * oldal;
|
||||
}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user