Determine the output displayed in the picture box when the command button is clicked (assume that the responses are 7 and 11):
Private Sub cmdDisplay_Click()
Dim a As Single, b As Single
Let a = Val(InputBox("Enter a number"))
Let b = Val(InputBox("Enter another number"))
If a > b then
Let a = a + 1
else
Let b = b + 1
End If
picResults.Print a; b
End Sub
Identify the error in the following program segment:
Private Sub cmdDisplay_Click()
Dim j As Single, k As Single
Rem Display "OK" if either j or k equals 5
Let j = 2
Let k = 3
If j = 5 Or k Then
picResults.Print "OK"
End If
End Sub
In the following program segment, simplify the code.
Private Sub cmdDisplay_Click()
Dim a As Single, b As Single
PicResults.Cls
Let a = Val(InputBox("Enter a number"))
Let b = Val(InputBox("Now enter another number"))
Let c = Val(InputBox("And now just one more number"))
If a < b then
If b < c Then
picResults.print b: "is between"; a; "and"; c
End If
End If
End Sub
Write a program will accept an integer, check to see if the number read in is:
After your program makes the determination of what kind of number it is then it should print out the number read in and an appropriate message describing the number.
Your program should use either a text box or an input box for input and a picture box to display the result.
Review the following table showing the location of books in the library stacks according to their call numbers.
100 to 199 lower level
200 to 500 and over 900 main floor
501 to 900 except 700 to 750 upper floor
700 to 750 archives
Write a program that requests the call number of a book (as an integer) as input and displays the location of the book. Use a select case block to implement the determination of location.
Your program should use either a text box or an input box for input and a picture box to display the result.
Do you have any questions, comments or suggestions? If so, please e-mail them to me at jcorlis@luc.edu.
To return to the COMP 125 (Monday) web site, click here.
To go to my home page, click here.
To go to the home page of Loyola University Chicago, click here.
Jack Corliss
Mathematical and Computer Sciences
Loyola University Chicago
Revised: 15 Janaury 1999