Visual BASIC

Visual BASIC Assignments (Second Marking Period)
 

Assignment for Thursday, December 10, 2009

Next 5 Primes

 

Write a VB program that will display the next 5 prime numbers after the number you enter.  Use the long data type.  Use the format function to display your answers separated appropriately by commas.



Assignment for Wednesday, December 2, 2009

Complete the Phases of the Moon Animation
 

Assignment for Monday, November 30, 2009

25 coins = $2.00

 

Write a computer program which will determine every way in which exactly 25 coins equals exactly $2.00.

 

Our algorithm will use a series of nested loops which generates every possible combination of dollar coins (e.g., Susan B. Anthony Dollars), half dollars, quarters, dimes, nickels, and pennies that has any chance of being the answer and then filters all these combinations through an If-Then statement that will display only the combinations that add up to 25 coins and have 2 dollars in value.

 

Make sure that the output is easy to understand.  Print words of explanation.  For example:

 

25 coins = $2.00

1 dollar coin

1 half dollar

0 quarter

3 dimes

0 nickels

20 pennies



Assignment for Monday, November 23, 2009
Multiplication Tables
Use nested loops to create the multiplication tables from 1x1=1 to 25x25=625.
Display the results in a multi-column listbox.


Assignment for Thursday, November 19, 2009
Dice Simulation
Convert the program written in class from one die to a pair of dice tossed 1000 times.  Remember that the odds of rolling a two or twelve are 1 in 36 while the odds of rolling a seven are 1 in 6.
intToss = Int(6*Rnd() + 1) + Int(6*Rnd() + 1) 


Assignment for Friday, November 13, 2009
Patterns and Sum
Complete the patterns assignment.  Note that the last button computes a sum. A copy of the class handout in Microsoft Word format is available on the Downloads Page of this website.


Bring the Flash Drive and Textbook to every class.