Menu

[Solved]04 22 2019 Lab 9 Exercise 1 Design Class Named Account Contains Aprivate Int Data Field Na Q37189421

04/22/2019 Lab 9 Exercise 1: Design a class named Account that contains: .Aprivate int data field named id for the account (d

04/22/2019 Lab 9 Exercise 1: Design a class named Account that contains: .Aprivate int data field named id for the account (default 0). .Aprivate double data field named balance for the account (default 0). .A private statie double data field named monthlyInterestRate that stores the current monthly interest rate (default 0). All accounts have the same interest rate. . A no-arg constructor that creates a default account. . The accessor (get) and mutator (set) methods for id, balance, and .A method named getMonthlyInterest that returns the amount of a monthly A constructor that creates an account with the specified id and initial balance. monthlyInterestRate. interest. A method named withdraw that withdraws a specified amount from the account. .A method named deposit that deposits a specified amount to the account. Hint: Monthly interest is balance monthlyInterestRate. The monthly! nterestRate isa percentage, e.g., like 4.5%. You need to divide it by 100. Write a test program that first sets a monthly!nterestRate equal to 4.5% for all the accounts. Use array to create two Account reference. For each account, prompt the users to enter ID, initial balance, amount of withdraw and amount of deposit. Create the first Account object using the constructor with the specified id and initial balance. Create the second Account object using the no-arg constructor, set the account ID and the initial balance using the mutator (set) methods for ID and balance, respectively. Finally, print the balance and the monthly interest for both accounts. Below is a sample run: Enter the monthly interest rate for all accounts (8): 4.5 Enter the ID: 1122 Enter the balance: 20000 Amount of withdra: 2500 Amount of deposit: 3000 Enter the ID: 1123 Enter the balance: 10000 Amount of withdraw: 500 *Information for Account ID: 1122* Account Balance: $20500.0 Monthly Interest: $922.5 04/22/2019 Information for Account ID: 1123 Account Balance: 9500.0 Monthly Interest: $427.5 Show transcribed image text 04/22/2019 Lab 9 Exercise 1: Design a class named Account that contains: .Aprivate int data field named id for the account (default 0). .Aprivate double data field named balance for the account (default 0). .A private statie double data field named monthlyInterestRate that stores the current monthly interest rate (default 0). All accounts have the same interest rate. . A no-arg constructor that creates a default account. . The accessor (get) and mutator (set) methods for id, balance, and .A method named getMonthlyInterest that returns the amount of a monthly A constructor that creates an account with the specified id and initial balance. monthlyInterestRate. interest. A method named withdraw that withdraws a specified amount from the account. .A method named deposit that deposits a specified amount to the account. Hint: Monthly interest is balance monthlyInterestRate. The monthly! nterestRate isa percentage, e.g., like 4.5%. You need to divide it by 100. Write a test program that first sets a monthly!nterestRate equal to 4.5% for all the accounts. Use array to create two Account reference. For each account, prompt the users to enter ID, initial balance, amount of withdraw and amount of deposit. Create the first Account object using the constructor with the specified id and initial balance. Create the second Account object using the no-arg constructor, set the account ID and the initial balance using the mutator (set) methods for ID and balance, respectively. Finally, print the balance and the monthly interest for both accounts. Below is a sample run: Enter the monthly interest rate for all accounts (8): 4.5 Enter the ID: 1122 Enter the balance: 20000 Amount of withdra: 2500 Amount of deposit: 3000 Enter the ID: 1123 Enter the balance: 10000 Amount of withdraw: 500 *Information for Account ID: 1122* Account Balance: $20500.0 Monthly Interest: $922.5 04/22/2019 Information for Account ID: 1123 Account Balance: 9500.0 Monthly Interest: $427.5

Expert Answer


Answer to 04/22/2019 Lab 9 Exercise 1: Design a class named Account that contains: .Aprivate int data field named id for the accou… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *