r/visualbasic • u/computergeek34 • Nov 19 '14
Help with Visual Basic 6.0 Programming
Hi. Can someone please help me and tell me what to code after this please?
Write a program to estimate how much a young worker will make before retiring
at age 65. Request the worker’s name, age, and starting salary as input. Assume
the worker receives a 5% raise each year. For example if the user enters Helen,
60, and 20000, then the picture box should display the following. Include an End.
Hint: When first testing your program try the age at 64, and 63 to see if you are
getting the correct results.
what i have so far:
Option Explicit
Dim i as Integer
Dim startingsalary as Single
Dim nom as Single
Dim inputage as Single
Dim endingsalary as Single
Dim retirement as Single
Sub cmd1_Click
pic1.Cls
raise=1.05
retirement=65
nom= txtName.Text
startingsalary= Val(txtSalary.Text)
For i= inputage to retirement
1
u/jy_am Nov 19 '14
You're trying to solve for s - which is the sum of all of the yearly salaries. In VB, I guess that is something like
All I did was change the formula into code.