Question
( The Account class ) Design a class named Account that contains: A private int data field named id for the account. A private float
(The Account class) Design a class named Account that contains:
A private int data field named id for the account.
A private float data field named balance for the account.
A private float data field named annualInterestRate that stores the current interest rate.
A constructor that creates an account with the specified id (default 0), initial balance (default 100), and annual interest rate (default 0).
The accessor and mutator methods for id , balance , and annualInterestRate .
A method named getMonthlyInterestRate() that returns the monthly interest rate.
A method named getMonthlyInterest() that returns the monthly 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.
Draw the UML diagram for the class, and then implement the class. (Hint: The method getMonthlyInterest() is to return the monthly interest amount, not the interest rate. Use this formula to calculate the monthly interest: balance * monthlyInterestRate . monthlyInterestRate is annualInterestRate / 12 . Note that annualInterestRate is a percent (like 4.5%). You need to divide it by 100 .)
Write a test program that creates an Account object with an account id of 1122, a balance of $20,000, and an annual interest rate of 4.5%. Use the withdraw method to withdraw $2,500, use the deposit method to deposit $3,000, and print the id, balance, monthly interest rate, and monthly interest.
From 7.3 which is already solved on cheg.
Programming Exercise 7.3. Call your files assn11-task2.py and account.py.
Read the exercise in the book first, so these instructions make sense. Instead of writing the test program as instructed in the book, write a program that obtains user input to use the Account class. The program should ask for the starting values for id, balance, and interest rate. The program then should present a menu where a user can access/modify their account. After each selection an appropriate message should be displayed. The menu should then be displayed again (Unless Exit is selected)
Example Menu:
(1): Display ID
(2): Display Balance
(3): Display Annual Interest Rate
(4): Display Monthly Interest Rate
(5): Display Monthly Interest
(6): Withdraw Money
(7): Deposit Money
(8): Exit
Make sure to read the rubric to see the additional requirements. Note: you do not need to write the program to test as described in the book. You will be writing a different program to use the class.
Rubric
5 pts: SoftwareDevelopment Lifecycle Plan
5 pts: Accurate UML diagram
5 pts: Implementation meets all requirements listed in book
5 pts: Account class is in its own module file account.py
5 pts: Follow proper coding conventions
5 pts: Input obtained properly from user
5 pts: Controlling input
You may assume all input received are proper numbers
You should not allow any negative numbers
Interest rate should not be greater than 10%
Loop and request input again if an invalid number is entered
10 pts: All calculations are accurate
5 pts: Menu loops properly until user enters 8
You may assume that all input are valid integers
Print a message and loop back to menu if an invalid menu number is entered
python 3
Step 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