

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Material Type: Lab; Class: Application Programming for Information Systems; Subject: Information Studies; University: Syracuse University; Term: Spring 2008;
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim counter, sum As Integer counter = 0 sum = 0
' add integers from 1 to 10 For counter = 1 To 10 Step 1 sum = sum + counter Next counter
' show the number to the user Label1.Text = CStr(sum) End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim counter, sum, square As Integer counter = 0 sum = 0 square = 0
' add the squares of integers from 1 to 6 For counter = 1 To 6 Step 1 square = counter * counter sum = sum + square Next counter
' show the number to the user Label1.Text = CStr(sum) End Sub
Public Class Form
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim counter, numyears As Integer Dim balance, interestrate, interestamount As Single
' Get the user balance, number of years, and interest rate balance = CSng(TextBox1.Text) numyears = CInt(TextBox2.Text) interestrate = CSng(TextBox3.Text)
' compute the interest for each year and add to balance For counter = 1 To numyears Step 1 interestamount = balance * interestrate balance = balance + interestamount Next counter