#include <iostream> using namespace std; int main() { double startingBalance, interestRate; double monthStartBalance, monthEndBalance; double balance; double total_deposits = 0, total_withdrawls = 0, total_interest = 0; cout << "Enter starting balance : "; cin >> startingBalance; while(startingBalance < 0) { cout << "Invalid.\nEnter starting balance : "; cin >> startingBalance; } cout << "Enter annual interest rate : "; cin >> interestRate; while(interestRate < 0) { cout << "Invalid.\nEnter annual interest rate : "; cin >> interestRate; } balance = startingBalance; for(int month=1; month<=3; month++) { monthStartBalance = balance; double amount_deposited, amount_withdrawn; cout << "Enter amount deposited in month " << month << ": "; cin >> amount_deposited; while(amount_deposited < 0) { cout << "Invalid.\nEnter amount deposited in month " << month << ": "; cin >> amount_deposited; } total_deposits += amount_deposited; balance += amount_deposited; cout << "Enter amount withdrawn in month " << month << ": "; cin >> amount_withdrawn; while(amount_withdrawn > balance || amount_withdrawn < 0) { cout << "Invalid.\nEnter amount withdrawn in month " << month << ": "; cin >> amount_withdrawn; } total_withdrawls += amount_withdrawn; balance -= amount_withdrawn; monthEndBalance = monthStartBalance + amount_deposited - amount_withdrawn; double avg = (monthStartBalance + monthEndBalance)/2.0; double interest = avg * interestRate / 1200; total_interest += interest; balance += interest; } cout << "\n\nStarting balance: $" << startingBalance << endl; cout << "Total depositis: $" << total_deposits << endl; cout << "Total withdrawls: $" << total_withdrawls << endl; cout << "Total interest posted: $" << total_interest << endl; cout << "Final Balance: $" << balance << endl; }
Hi. Please find the answer above.. In case of any doubts, you may ask in comments. You may upvote the answer if you feel i did a good work!
C++ 18. Savings Account Balance Write a program that calculates the balance of a savings account...
i need this to be in OOP using C++ 25. Savings Account Balance Write a program that calculates the balance of a savings account at the end of a three-month feried. It should ask the user for the starting balance and the annual interest rate. A loop abculd then iterate once for every month in the period, performing the following steps: B) A) Ask the user for the total amount deposited into the account during that month and add it...
solve this JAVA problem in NETBEANS Problem #12 in page 400 of your text (6th edition): SavingsAccount Class. Design a SavingsAccount class that stores a savings account's annual interest rate and balance. The class constructor should accept the amount of the savings account's starting balance. The class should also have methods for subtracting the amount of a withdrawal, adding the amount of a deposit, and adding the amount of monthly twelve. To add the monthly interest rate to the balance,...
Write in C++ using emacs. Write a program that calculates the ending balance of several savings accounts. The program reads information about different customers’ accounts from an input file, “accounts.txt”. Each row in the file contains account information for one customer. This includes: the account number, account type (premium, choice, or basic account), starting balance, total amount deposited, and total amount withdrawn. Your program should: - open the file and check for successful open, - then calculate the ending balance...
Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should prompt the user for the number of years. Be sure to ask for each months average rainfall for each year. The outer loop will iterate once for each year while the inner loop will iterate 12 times(one time per month) prompting for the months average rainfall on each iteration. Display the number of months, the total inches...
Write a program to produce a table that shows the balance of a bank account after each month, assuming that interest is compounded monthly and no additional money is added or withdrawn from the account. Consider this example to understand how this calculation can be done with a loop. Suppose you put $10,000 into an account with an annual percentage rate (APR) of 5.0%. After one month, the account would receive an interest credit of 10000 * 5.0 / 1200....
5. Create a java application that uses nested loops to collect data and calculate the average rainfall over a peniod of years First the program should ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate 12 times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month, the program should display the number of months, the total...
Project 9-2: Account Balance Calculator Create an application that calculates and displays the starting and ending monthly balances for a checking account and a savings account. --->Console Welcome to the Account application Starting Balances Checking: $1,000.00 Savings: $1,000.00 Enter the transactions for the month Withdrawal or deposit? (w/d): w Checking or savings? (c/s): c Amount?: 500 Continue? (y/n): y Withdrawal or deposit? (w/d): d Checking or savings? (c/s): s Amount?: 200 Continue? (y/n): n Monthly Payments and Fees Checking fee: $1.00 Savings...
Suppose you have a certain amount of money in a savings account that earns compound monthly interest, and you want to calculate the amount that you will have after a specific number of months. The formula is as follows: f = p * (1 + i)^t • f is the future value of the account after the specified time period. • p is the present value of the account. • i is the monthly interest rate. • t is the...
Write them in python IDLE ***** 5. Average Rainfall Write a program that uses nested loops to collect data and calculate the average rainfall over a period of years. The program should first ask for the number of years. The outer loop will iterate once for each year. The inner loop will iterate twelve times, once for each month. Each iteration of the inner loop will ask the user for the inches of rainfall for that month. After all iterations,...
Write a program that calculates the amount of money that you must invest In a savings account at a given interest rate for a given number of years to have a certain dollar amount at me end of the period Y our program will ask the user for the amount the user wants to have at the end of the term (future value). the number of years the user plans to let the money stay in the account, and the...