Java Code using JOptionPane:
Import javax.swing.JOptionPane;
Public class BankAccount {
Public static void main(String[] args)
String customerName = JOptionPane.showInputDialog(null,
“This program asks the user for a name,\n”
+ “bank account number, and beginning balance\n”
+ “and then calculates the balance at the end of the month with
corresponding 1% interest.\n\n”
+ “Please enter customer name”,
“Input”, JOptionPane.QUESTION_MESSAGE);
String accountNumber = JOptionPane.showInputDialog(null,
“Please enter account number”,
“Input”, JOptionPane.QUESTION_MESSAGE);
String balanceInput = JOptionPane.showInputDialog(null,
“Please enter beginning balance”,
“Input”, JOptionPane.QUESTION_MESSAGE);
Double beginningBalance = Double.parseDouble(balanceInput);
Double interestRate = 0.01;
Double endingBalance = beginningBalance + (beginningBalance *
interestRate);
String message = String.format(“Customer Name: %s\nAccount
Number: %s\nEnding Balance: %.2f”,
customerName, accountNumber, endingBalance);
JOptionPane.showMessageDialog(null, message,
“Account Information”, JOptionPane.INFORMATION_MESSAGE);