import javax.swing.JOptionPane;
class rumus1
{
double y;
private double x;
void cetak()
{
System.out.println("y = "+y);
}
void input()
{
String data;
data=JOptionPane.showInputDialog("Nilai x");
x=Double.valueOf(data).doubleValue();
y=(2*x)+5;
}
}
public class PBO1_1
{
public static void main(String[] Args)
{
rumus1 cari1=new rumus1();
cari1.input();
cari1.cetak();
}
}
Belum ada tanggapan untuk "Class Program with Language C++"
Post a Comment