Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help with the below C# code to convert it to Java code console app.Thanks! 1 using System; using System.Collections.Generic; namespace BankProject // class for
Please help with the below C# code to convert it to Java code console app.Thanks!
1 using System; using System.Collections.Generic; namespace BankProject // class for Saving account public class SavingsAccount { // members int rate = 1; float balance; bool closed = false; public SavingsAccount(bool closed) this.closed = closed; } int account Number; static int GetAccount Number = 1001; string accountType = "Savings"; // constructor that initialized rate and balance public SavingsAccount(int rt, float balance) rate = rt; this.balance = balance; account Number = GetAccount Number++; } // method to close an account public void closelstring name) { closed = true; Console.WriteLine("Account closed"); Console.WriteLine("Account number:" + account Number); Console.WriteLine("Account holder Name:" + name); Console.WriteLine("Balance:" + balance); Console.WriteLine("Account type:" + accountType); Console.WriteLine("With interest 1 %:"); Console.WriteLine("Interest amount:" +0.01f . balance); } // method to print account informaion public void print(string name) { Console.WriteLine("Account number:" + account Number); Console.WriteLine("Account holder name:" + name); Console.WriteLine("Balance:" + balance); Console.WriteLine("Account type:" + accountType); 2 Console.WriteLine("Interest rate:" + rate: } // getters and setters public int getAccount Number() { return accountNumber; } public string getAccountType() { return accountType; } // method to deposit an amount public void deposit(float amount) { balance += amount; } // method to withdraw an amount public float withdraw(float amount) if (amount > balance) { Console.WriteLine(" Insufficient balance!"); return 0; } return balance -= amount; D // class representing a customer public class Customer { // a list for storing all the accounts ListStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started