Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Help please with comment the below Java code. What the classes, objects, constructors and methods do. Thanks! public class SavingsAccount { float rate = 1;

Help please with comment the below Java code. What the classes, objects, constructors and methods do. Thanks! public class SavingsAccount { float rate = 1; float balance; boolean closed = false; public SavingsAccount(boolean closed) { this.closed = closed; } int accountNumber; static int GetAccountNumber=1001; String accountType = "Savings"; public SavingsAccount(float rt, float balance) { rate = rt; this.balance = balance; accountNumber = GetAccountNumber++; } public void close(String name) { closed = true; System.out.println("Account closed"); System.out.println("Account number: " + accountNumber); System.out.println("Account holder Name: "+name); System.out.println("Balance: " + balance); System.out.println("Account type: " + accountType); System.out.println("With interest 1,2 %:"); System.out.println("Interest amount: " + 0.012f * balance); } public void print(String name) { System.out.println("Account number: " + accountNumber); System.out.println("Account holder name: " + name); System.out.println("Balance: " + balance); System.out.println("Account type: "+accountType); System.out.println("Interest rate: "+rate); } public int getAccountNumber() { return accountNumber; } public String getAccountType() { return accountType; } public void deposit(float amount) { balance += amount; } public float withdraw(float amount) { if (amount > balance) { System.out.println(" Insufficient balance!"); return 0; } return balance -= amount; } }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transact SQL Cookbook Help For Database Programmers

Authors: Ales Spetic, Jonathan Gennick

1st Edition

1565927567, 978-1565927568

More Books

Students also viewed these Databases questions

Question

Who is the target audience (or audiences)?

Answered: 1 week ago

Question

1. Who will you assemble on the team?

Answered: 1 week ago