Bank Balance Calculator Program Assignment Answers Needed
Your Question:
Write a program using the while loop, called BankBalance, to calculate and display the annual year-end bank balance for customers. An example is shown below. The program asks three inputs from the customer: 1) the initial bank balance in double dollar amount e.g., (% 2021.21). 2) the annual interest rate in integer format (e.g., 2%). 3) the number of years that want to be displayed for the year-end balance c# Enter the innitial bank balance ≫1000 Enter the annual interest rate >5 Enter the number of year to display ≫6 Year 1: $1,050.00 Year 2: $1,102.50 Year 3: $1,157.63 Year 4: $1,215.51 Year 5: $1,276.28 Year 6: $1,340.10
Step By Step Answers with Explanation
{
// Prompt the user for initial bank balance
double annualInterestRate = Convert.ToDouble(Console.ReadLine()) / 100; // Convert to decimal
// Prompt the user for the number of years
while (year <= numberOfYears)
{
// Update the initial balance for the next year
initialBalance = yearEndBalance;
}