You are on page 1of 1

import javax.swing.

JOptionPane;
public class Relasyon{

public static void main (String []args){

BoyBawang delizo = new BoyBawang("Darlito", 20, 4);


GirlBawang podique = new GirlBawang("Niks", 17, 5, 30, 32);

JOptionPane.showMessageDialog(null, delizo.getName() + "\n" +


delizo.getAge() + "\n" + delizo.getHeight());

JOptionPane.showMessageDialog(null,podique.getName() + "\n" +
podique.getAge() + "\n" + podique.getHeight() + "\n" + podique.getWaistSize() +
"\n" + podique.getChestSize());

while(true){

int choice = Integer.parseInt(JOptionPane.showInputDialog("Enter your choice


\n 1. Eat lechon \n 2. Drink Milk \n 3. Diet"));

switch(choice){
case 1:
double taba = Double.parseDouble(JOptionPane.showInputDialog("Enter
how many tons of lechons?"));
podique.setWaistSize(podique.getWaistSize()+(taba*0.3));
if (podique.getWaistSize()>40)
JOptionPane.showMessageDialog(null, "Break na sila ni Delizo");
break;
}
JOptionPane.showMessageDialog(null, delizo.getName() + "\n" +
delizo.getAge() + "\n" + delizo.getHeight());

JOptionPane.showMessageDialog(null,podique.getName() + "\n" +
podique.getAge() + "\n" + podique.getHeight() + "\n" + podique.getWaistSize() +
"\n" + podique.getChestSize());
}
}
}

You might also like