Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Plz Solve Qs 6 While in application with two Javi Claas server Java and Chentayam java with me given scenario 6. Write a class BankAccount
Plz Solve Qs 6
While in application with two Javi Claas server Java and Chentayam java with me given scenario 6. Write a class BankAccount and an inner class Money in the Bank Account class. The [CO3,C3, inner class Money has two instance variables: dollar, and cent. Add a constructor of Mark: 71 the Money class which can take the amount in string and split it into dollar and cents and initialize the instance variable of the class. Add getAmount() function in Money class that returns the dollar and cent parts together. Again add addin Money secondAmount) function that can take parameter of type Money and add the dollar part and cent part to the instance variable of the class. Now Add a constructor of Bank Account which initialize the Money with "0.00" by creating an instance object of Money. Here the value o before the decimal part is the dollar part and 00 after the decimal is the cent part. Add makeDeposit(String deposit Amount) function that can deposit the money by calling the addin(new Money(depositAmount) function of the inner class Money. Also show the usage of the Bank Account and Money class in the main method of a class. Design a JAVA application that can perform the task as given in the above scenario, Page 3 of 2Step 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