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.

  1. 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

  2. Display a list of 15 random integers from -10 to 10.
  3. Find the absolute value of an inputted number.
  4. Change the background of the form to be a random RGB color.
  5. 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

 
51946

 

 
© 2004-2008, Jerel L. Welker
Page Updated: January 15, 2009