Professional Documents
Culture Documents
Informatika Test
Informatika Test
Informatika Test
using System.Windows.Forms;
namespace WindowsFormsApp3
{
class Rectangle
{
private int length;
private int width;
public int Length
{
get { return this.length; }
set
{
if (value > 0)
this.length = value;
else
MessageBox.Show("Improper lenght");
}
}
public int Width
{
get { return this.width; }
set
{
if (value > 0)
this.width = value;
else
MessageBox.Show("Improper width");
}
}
using System.Windows.Forms;
namespace WindowsFormsApp3
{
public partial class Form1 : Form
{
Random r = new Random();
int random;
public int[] rectangleArray = new int[6];
public Form1()
{
InitializeComponent();
}
rectangleOne.Length = int.Parse(textBoxLenght.Text);
rectangleOne.Width = int.Parse(textBoxWidth.Text);