Question: import javax.swing.*; public class CustomerAccount { public static void main(String[] args) { int num; double balance; String input; input = JOptionPane.showInputDialog(Null, Enter your account number);

import javax.swing.*;

public class CustomerAccount

{

public static void main(String[] args)

{

int num;

double balance;

String input;

input = JOptionPane.showInputDialog(Null, "Enter your account number");

num = Integer.parseInt(input);

input = JOptionPane.showInputDialog(null, "Enter balance due");

balance = Double.parseDouble(input);

try

{

CustomerAccount ca = new CustomerAccount(num, balance);

JOptionPane.showMessageDialog(null, "Customer #" + num + " has a balance of $" + balance);

}

catch(HighBalanceException hbe)

{

JOptionPane.showMessageDialog(null, "Customer #" + num + " has a blance of $" + balance + " which is higher than the credit limit");

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!