Need Help Understanding

I'm not asking for the answers, but how to write this, I understand reading code but not writing it.

Create a class named [size=3][b]checkingaccount[/b][/size] with data fields for an account number and a balance. Include a constructor that takes arguments for each field The constructor sets the balance to 0 if it is below the required $200.00 minimum for an account. Also include a method that displays account details, including an explanation if the balance was reduced to 0. Write an Application named [size=3][b]testaccount[/b][/size] in which you instantiate two [size=3][b]checkingaccount[/b][/size] objects, prompt the user for values for the account number and balance, and display the values of both accounts. Save both the [size=3][b][/b][/size] and [size=3][b][/b][/size] files.


  • public class CheckingAccount{

    private String accountNumber;
    private double balance;

    public CheckingAccount(String accountNumber, double balance){
    this.accountNumber = accountNumber;
    if (balance < 200){
    this.balance = 0;
    this.balance = balance;


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion