Problem Description: (The Account class) Design a class named Account that contains: A constructor that creates an accou

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Problem Description: (The Account class) Design a class named Account that contains: A constructor that creates an accou

Post by answerhappygod »

Problem Description The Account Class Design A Class Named Account That Contains A Constructor That Creates An Accou 1
Problem Description The Account Class Design A Class Named Account That Contains A Constructor That Creates An Accou 1 (53.71 KiB) Viewed 115 times
Problem Description: (The Account class) Design a class named Account that contains: A constructor that creates an account with the specified private "id", "balance", and "annualInterestRate". A method named "withdraw" withdraws a specified amount from the account and checks if the amount is less than the balance or not. If the amount is less, it prints ("Not allowed. Withdraw a sum less than the balance.") A method named deposit that deposits a specified amount to the account. A method named getMonthlyInterestRate that returns the monthly interest rate *(by dividing it by the number of months in the year.). A method named getMonthlyInterest() returns the monthly interest *(by multiplying the balance by the MonthlyInterestRate). ▸ . The first try is free; after that, 5% for each try. For example: Test account Account(0, 0, 1.5) account.withdraw(2508) account.deposit(3000) print("ID is " + str(account.getId())) account withdraw(2508) print("Balance is " + str(account.getBalance())) print("Monthly interest rate is + str(account.getMonthlyInterest Rate())) print("Monthly interest is " + str(account.getMonthlyInterest())) Result Not allowed. Withdraw a sum less than the balance. ID is e Balance is see Monthly interest rate is 0.125 Monthly interest is 62.5
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply