Answer to Question #185423 in Visual Basic for tafadzwa

Question #185423

an online bank wants you to create a program that shows prospective customers how their deposits with grow. Your program should read the intial balance and the annual interest rate. interest is compounded monthly .display the balances after the first three months



1
Expert's answer
2021-04-25T13:56:25-0400
Module Module1


    Sub Main()
        'Read the intial balance and the annual interest rate
        Console.Write("Enter the initial balance: ")
        Dim initialBalance As Double = Double.Parse(Console.ReadLine())
        Console.Write("Enter the annual interest rate: ")
        Dim annualInterestRate As Double = Double.Parse(Console.ReadLine())
        Dim monthlyInterest As Double = (annualInterestRate / 100.0) / 12.0
        'Dim currentBalance As Double = initialBalance + (initialBalance * monthlyInterest)
        'Display the balances after the first three months
        Dim balance As Double = initialBalance + (initialBalance * monthlyInterest)
        Console.WriteLine("Your balance after 1 month: " + balance.ToString("C"))
        For month As Integer = 2 To 3
            balance += (balance * monthlyInterest)
            Console.WriteLine("Your balance after " + month.ToString() + " month: " + balance.ToString("C"))
        Next
        Console.ReadLine()
    End Sub


End Module

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS