Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PersegiPanjang{
- int panjang;
- int lebar;
- PersegiPanjang(this.panjang,this.lebar);
- int hitungLuas(){
- return panjang * lebar;
- }
- int hitungKeliling(){
- return 2* ( lebar + panjang);
- }
- }
- void main(){
- var OPP = PersegiPanjang(5,3);
- print('Luas = ${OPP.hitungLuas()}');
- print('Keliling = ${OPP.hitungKeliling()}');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement