0% found this document useful (0 votes)
14 views2 pages

Tugas Yang Dikerjakan Dalam Pratikum

The document defines an interface called IGadget with methods for calling, internet, sending email, and taking pictures. It then defines two classes - Tablet and HandPhone - that implement this interface. Tablet overrides the methods to add functionality for sending email, internet, and taking pictures. HandPhone similarly overrides the methods, providing its own implementation for calling, sending email, internet, and taking pictures.

Uploaded by

Mardaleni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

Tugas Yang Dikerjakan Dalam Pratikum

The document defines an interface called IGadget with methods for calling, internet, sending email, and taking pictures. It then defines two classes - Tablet and HandPhone - that implement this interface. Tablet overrides the methods to add functionality for sending email, internet, and taking pictures. HandPhone similarly overrides the methods, providing its own implementation for calling, sending email, internet, and taking pictures.

Uploaded by

Mardaleni
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

Tugas yang dikerjakan dalam pratikum


namespace pratikum_02_mardaleni
{
interface IGadget
{
void call();
void internet();
void send_email();
void take_picture();
}
class Tablet : IGadget
{
private int status = 0;
private string p;
public Tablet(string p)
{
this.p = p;
}
public void send_email()
{
Console.WriteLine(" send_ email anda.....");
}
public void internet()
{
Console.WriteLine(" send email melaui internet...");
}
public void call()
{}
public void take_picture()
{
Console.WriteLine(" take_picture ......");
}
public int Status
{
get { return this.status; }
set { this.status = value; }
}
class HandPhone : IGadget
{
public void take_picture()
{
Console.WriteLine(" take_picture ......");
}
public void send_email()
{
Console.WriteLine("kirim pesan disini ....");
}
public void call()
{
Console.WriteLine("call di sini ...");
}
public void internet()
{
Console.WriteLine(" send email melaui internet...");
}
}
}

Laboratorium Pemrograman dan Basis Data

Hasil :

Laboratorium Pemrograman dan Basis Data

You might also like