import javax.swing.*; class account { // information: double balance = 0; String owner; double interest; int pin; // operations - "methods" or "functions public void deposit(double amount) { balance = balance + amount; } public void withdraw(double amount) { if ( (amount < balance) && (amount > 0) ) balance = balance - amount; } public double inquiry() { return balance; } } public class prog1 { public static void main(String[] args) { account savings = new account(); // objects account checking = new account(); savings.deposit(300); checking.deposit(200); savings.withdraw(50); // output JOptionPane.showMessageDialog(null,"savings balance is " + savings.inquiry()); System.exit(0); } }