Lab
Exercise Two
In
this exercise you are to create a new main class to do the following:
Declare a String variable and assign to it a String object constructed from your name.
Write a statement to display the variable in a JOptionPane window.
Declare an int variable and assign to it the value of the String variable's length method.
Write a statement to display the variable in a JOptionPane window.
Declare a String variable named out and assign to it the name variable followed by a space followed by the int variable (use the + operator).
Construct a BankAccount object using "1234567" as the account number and 0.00 balance and assign it to a BankAccount variable. The BankAccount class is available from Lab Exercise One.
Deposit 100 dollars into the account using the variable and the BankAccount class's deposit method.
Use the + operator to concatenate the BankAccount variable to the String variable out.
Construct a JTextArea with 20 rows and 20 columns and assign it to a JTextArea variable.
Use the setText method of JTextArea to output the String variable out on the JTextArea.
Construct a JScrollPane from the JTextArea and display it in a JOptionPane window.
Run your program.