
In the btnCalc_Click procedure, change the For…Next statement that controls the years to a Do…Loop statement.
Option Explicit On
Option Strict On
Option Infer Off
Public Class frmMain
Private Sub btnCalc_Click(sender As Object, e As EventArgs) Handles btnCalc.Click
Dim dblDeposit As Double
Dim dblBalance As Double
Double.TryParse(txtDeposit.Text, dblDeposit)
txtBalance.Text = "Rate" & ControlChars.Tab &
"Year" & ControlChars.Tab & "Balance" &
ControlChars.NewLine
End Sub
Private Sub txtDeposit_Enter(sender As Object, e As EventArgs) Handles txtDeposit.Enter
txtDeposit.SelectAll()
End Sub
Private Sub txtDeposit_TextChanged(sender As Object, e As EventArgs) Handles txtDeposit.TextChanged
txtBalance.Text = String.Empty
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub txtDeposit_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDeposit.KeyPress
' Allows the text box to accept only numbers, the period, and the Backspace key.
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then
e.Handled = True
End If
End Sub
End Class

Answer:
Visual Studio Source Code:
Method 1:
Form1.vb:
Option Explicit On
Option Strict On
Option Infer Off
Public Class Form1
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim dblDeposit As Double
Dim dblBalance As Double
Double.TryParse(txtDeposit.Text, dblDeposit)
txtBalance.Text = "Rate" & ControlChars.Tab &
"Year" & ControlChars.Tab & "Balance" &
ControlChars.NewLine
For dbl_Rate As Double = 0.03 To 0.07 Step 0.01
txtBalance.Text = txtBalance.Text &
dbl_Rate.ToString("P0") & ControlChars.NewLine
For int_Year As Integer = 1 To 5
dblBalance = dblDeposit * (1 + dbl_Rate) ^ int_Year
txtBalance.Text = txtBalance.Text &
ControlChars.Tab & int_Year.ToString &
ControlChars.Tab & dblBalance.ToString("C2") &
ControlChars.NewLine
Next int_Year
Next dbl_Rate
End Sub
Private Sub txtDeposit_Enter(sender As Object, e As EventArgs) Handles txtDeposit.Enter
txtDeposit.SelectAll()
End Sub
Private Sub txtDeposit_TextChanged(sender As Object, e As EventArgs) Handles txtDeposit.TextChanged
txtBalance.Text = String.Empty
End Sub
Private Sub btnExit_Click(sender As Object, e As EventArgs) Handles btnExit.Click
Me.Close()
End Sub
Private Sub txtDeposit_KeyPress(sender As Object, e As KeyPressEventArgs) Handles txtDeposit.KeyPress
If (e.KeyChar < "0" OrElse e.KeyChar > "9") AndAlso e.KeyChar <> "." AndAlso e.KeyChar <> ControlChars.Back Then
e.Handled = True
End If
End Sub
End Class
Output Screenshot:
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps with 4 images

- I'm not sure how to fix my error import csv #This is the classclass ConvertCSVToJSON: def __init__(self, headings, ID, linesFromFile, inputFileName, outputFileName="Project7Output.txt"): self.headings=headings # Headings (row 1 of the file) self.ID=ID self.linesFromFile=linesFromFile # rows2-end of file (EOF) self.outputFileName=outputFileName self.inputFileName=inputFileName def createKeyValuePair(self, key, value): # Think about parameters and how the code will work result="\""+key+"\""+":"+value return result #create a line function/method in class to have access to headings and file. def createLine(self, ID, line): #splits the line into different components lineComponets=line.split(",") dictionary={}#creats a dictionary for the componets for i in range(len(self.heading)): dictionary[self.headings[i]]=lineComponents[i] #adds ID as a keyvalue pair dictionary["ID"]=str(ID) #should convert to json…arrow_forwardWhich of the above choices (A, B, C or D) retrieves an behaviorList for the zebraZirly Animal object? Assume any undeclared or uninitialized variables that are not shown in this code were correctly setup.Animal zebraZirly = // ... Omitted for brevity // A Behavior tempList = zebraZirly.getBehaviorList(); // B Behavior[] tempList = zebraZirly.getBehaviorList(); // C Behavior[] tempList = zebraZirly.getBehaviorList(behaviorList); // D Behavior[] tempList = this.behaviorList.length;arrow_forwardModify the Dice Poker program from this chapter to include any or all of the following features: 1- Splash Screen. When the program first fires up, have it print a short introductory message about the program and buttons for "Let's Play" and "Exit." The main interface shouldn't appear unless the user se- lects "Let's Play." 2-Add a "Help" button that pops up another window displaying the rules of the game (the payoffs table is the most important part). 3-Add a high score feature. The program should keep track of the 10 best scores. When a user quits with a good enough score, he/she is invited to type in a name for the list. The list should be printed in the splash screen when the program first runs. The high-scores list will have to be stored in a file so that it persists between program invocations.arrow_forward
- JAVAarrow_forwardFor main.CPP file in lines 32 and 33 on visual studio community 2022 it's saying that getline is unidentified why is that and how do i fix it.arrow_forwardModalProp detailsanimationType it's an enum of ('none', 'slide', 'fade') and it controls modal animation.visible its a bool that controls modal visiblity.onShow it allows passing a function that will be called once the modal has been shown.transparent bool to set transparency.onRequestClose (android) it always defining a method that will be called when user tabs back buttononOrientationChange (IOS) it always defining a method that will be called when orientation changessupportedOrientations (IOS) enum('portrait', 'portrait-upside-down', 'landscape', 'landscape-left', 'landscape-right')Modal component is a simple way to present content above an enclosing view.using given Modal make a Basic Example?arrow_forward
- Java script add event help needed 5) In the "myPage" section, select the fifth// button and assign a "click" listener. When// clicked, it should toggle the class named// "fourthPara" for the fifth paragraph// in the "myPage" section. // 6) In the "myPage" section, select the sixth// button and assign a "click" listener. When// clicked, it should change the text content// of the sixth paragraph in the "myPage"// section to:// "Event Bubbling. Stopping propagation."// Your event listener should be set to// Event Bubbling. You should stop the// event propagation. HERE IS THE INDEX HTML : <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Practice Assignment 11</title> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/mocha/8.1.1/mocha.css"…arrow_forwardcan someone help me or teach whats wrong with my code please badly needed this nightarrow_forwardJava Questions - (Has 2 Parts). Based on each code, which answer out of the choices "A, B, C, D, E" is correct. Each question has one correct answer. Thank you. Part 1 - Which option of the setDefaultCloseOperation() method can ensure that Java application willbe properly terminated when the user attempts to close the "form"? A. HALT_ON_CLOSEB. TERMINATE_ON_CLOSEC. EXIT_ON_CLOSED. DELETE_ON_CLOSEE. DESTROY_ON_CLOSE Part 2 - In Java, which can ensure the "Form" class to inherit from JFrame class? A. public class Form gets JFrame { }B. public class Form inherits JFrame { }C. public class Form extends JFrame { }D. public class Form : public JFrame { }E. public class Form implements JFrame { }arrow_forward
- In java plsarrow_forwardAdd a toString method to your Account class. For the purposes of this assignment, please use the toString display the following: This account contains $x. You have earned $y in the last month. where x is the account balance (please don't format the decimals) and y is the monthly interest earned, obtained from the getMonthlyInterest method. Compile and test in a driver by creating and printing an Account object. Add an equals method to your Account class. Two Account objects are equal if their balance and annualInterestRates are equal. Compile and test in your driver by creating 2 Account objects to see if they are equal.arrow_forwardJAVA PPROGRAM ASAP Please Modify this program ASAP BECAUSE IT IS HOMEWORK ASSIGNMENT so it passes all the test cases. It does not pass the test cases when I upload it to Hypergrade. Because RIGHT NOW IT PASSES 0 OUT OF 1 TEST CASES. I have provided the failed the test cases and the inputs as a screenshot. The program must pass the test case when uploaded to Hypergrade. import java.io.File;import java.io.FileNotFoundException;import java.util.Scanner;public class Main { public static void main(String[] args) { Scanner keyboard = new Scanner(System.in); String fileName; System.out.println("Please enter the file name or type QUIT to exit:"); fileName = keyboard.nextLine().trim(); while (!fileName.equalsIgnoreCase("QUIT")) { File file = new File(fileName); if (file.exists()) { int wordCount = countWords(file); System.out.println("Total number of words: " + wordCount + "\n);…arrow_forward
- Computer Networking: A Top-Down Approach (7th Edi...Computer EngineeringISBN:9780133594140Author:James Kurose, Keith RossPublisher:PEARSONComputer Organization and Design MIPS Edition, Fi...Computer EngineeringISBN:9780124077263Author:David A. Patterson, John L. HennessyPublisher:Elsevier ScienceNetwork+ Guide to Networks (MindTap Course List)Computer EngineeringISBN:9781337569330Author:Jill West, Tamara Dean, Jean AndrewsPublisher:Cengage Learning
- Concepts of Database ManagementComputer EngineeringISBN:9781337093422Author:Joy L. Starks, Philip J. Pratt, Mary Z. LastPublisher:Cengage LearningPrelude to ProgrammingComputer EngineeringISBN:9780133750423Author:VENIT, StewartPublisher:Pearson EducationSc Business Data Communications and Networking, T...Computer EngineeringISBN:9781119368830Author:FITZGERALDPublisher:WILEY





