using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication18
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication18
{
public class luass
{
private int luas;
private string text;
public luass(int sisi)
{
luas=sisi*sisi;
text = "persegi";
}
public luass(int panjang, int lebar)
{
int x;
if (panjang<lebar)
{
x = panjang;
panjang = lebar;
lebar = x;
}
luas=panjang*lebar;
text = "persegi panjang";
}
public void printdata()
{
Console.WriteLine("luas {1} = {0}", luas,text);
}
}
class Program
{
static void Main(string[] args)
{
luass luas1 = new luass(5);
luass luas2 = new luass(5, 6);
luas1.printdata();
luas2.printdata();
}
}
}
}
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication18
{
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication18
{
public class luass
{
private int luas;
private string text;
public luass(int sisi)
{
luas=sisi*sisi;
text = "persegi";
}
public luass(int panjang, int lebar)
{
int x;
if (panjang<lebar)
{
x = panjang;
panjang = lebar;
lebar = x;
}
luas=panjang*lebar;
text = "persegi panjang";
}
public void printdata()
{
Console.WriteLine("luas {1} = {0}", luas,text);
}
}
class Program
{
static void Main(string[] args)
{
luass luas1 = new luass(5);
luass luas2 = new luass(5, 6);
luas1.printdata();
luas2.printdata();
}
}
}
}
No comments:
Post a Comment