|
|
Visual Basic
07 Numeric Function Programs
This section introduces you to numeric functions
to assist the programmer with handling numeric values. Use the help
menu to look up the functions abs(), sqr(), fix(), int(), cint(), rnd() and
mod() for assistance with these problems.
Unit 7 Project: Write all programs on one form using File menu
structure for each program. Save the program as 07xxxfun.frm. When a
new file menu option is selected, all previous output on the form should be
cleared.
- Simulate the rolling of two six-sided die until the sum
of the dice is 7. For each roll, show the number of the roll, the roll of
each die and the sum as:
|
Roll #
|
Dice 1
|
Dice 2
|
Sum
|
|
1
|
3
|
2
|
5
|
|
2
|
5
|
2
|
7
|
- Display a list of 15 random integers from -10 to 10.
- Find the absolute value of an inputted
number.
- Change the background of the form to be a
random RGB color.
- Given a dividend and divisor, write the answer
in dividend = quotient * divisor + remainder form. For example
with a dividend of 14 and divisor of 4, the statements should
appear as "14 = 3 * 4 + 2".
Visual Basic Assignment
Page
|
|