Question: Write a program that executes the following steps: Create a new bank account. Show the balance of the bank account. If the balance of the

Write a program that executes the following steps:

Create a new bank account.

Show the balance of the bank account.

If the balance of the bank account is >= 20 dollars, do the following steps:

Print "Purchasing movie ticket." including the full stop at the end of the sentence.

Withdraw $20 from the account.

Show the balance of the bank account again.

Otherwise, print "You need more money to buy a movie ticket." including the full stop at the end of the sentence.

The following sample I/O shows how your program should behave when the account has at least $20:

Creating a new bank account Enter account name:  user inputs Shelly Martin  Enter initial balance: $  user inputs 567.00  Shelly Martin's account has $567.00 Purchasing movie ticket. Shelly Martin's account has $547.00 

Otherwise, your program should behave as follows:

Creating a new bank account Enter account name:  user inputs Shelly Martin  Enter initial balance: $  user inputs 7.00  Shelly Martin's account has $7.00 You need more money to buy a movie ticket. 

public class Exercise6 {

public static void main(String[] args) {

// INSERT YOUR CODE HERE

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To write the program specified well create a simple Java program that simulat... View full answer

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!