Welcome, Guest. Please login or register.
May 23, 2012, 10:44:25 PM
Home Help Search Login Register
News: watch videos at www.video.fysisoft.com  Share your Ideas at this Forum..Share Knowledge....

+  ..::ysapak.com Study help forum::..
|-+  Study Online, Notes, Tips, Tricks, Helping Material, Past papers, Solved, Unsolved Model Papers, Test Papers, Genernal Knowledge Information, Free Educational Courses
| |-+  Visual Basic
| | |-+  The Randomize statement ensures that the start of each sequence of random number
0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Go Down Send this topic Print
Author Topic: The Randomize statement ensures that the start of each sequence of random number  (Read 1948 times)
admin
Administrator
Hero Member
*****

Ranking: 200
Offline Offline

Posts: 16074


Looking for some members that can help other students in Studies


« on: January 24, 2011, 07:34:07 PM »

The Randomize statement ensures that the start of each sequence of random numbers is
also random.
 
 
Open a new form and create a l ink to the program from the menu form (Main) under
Iterations … Post-test Loops … Averages.  Write an application to display the average of
10 numbers entered by the user using a post-test loop wi th the syntax Do …..Loop
Until to ask for each number.  Remember to use the Val () function to convert strings
to numbers.  Each number might be asked for with an input box using the syntax:
 

•  Do ……. Loop Until (comparison test)
•  Do ……. Loop While (comparison test)
Both are post-test loops where the comparison test appears at the bottom of the loop
meaning that the code in the loop must execute at least once.  These are both equivalent
to the pseudocode syntax 
 REPEAT ……. UNTIL
 
Write the algorithm for this application in pseudocode that explains what every line in the
program does.
 
Activity 11
Create a program to generate the first 20 Fibonacci numbers.  This time use a counter to
control the number of iterations.  Add a Picture Box to print your results to.  Make sure
the PictureBox.Font Transparent = False, AutoRedraw = True and that the BackColor is
different from the ForeColor.  Use the fol lowing code to help you.
Dim FibNumber As Integer, FibNext As Integer, Counter As Integer
‘Initialise
FibNumber = 0
FibNext = 1
Picture1 Print "Ist 20 Fibonacci Numbers"
Do While Counter < 20
Picture1 Print FibNumber & ", ";
‘trailing semicolon stops the Print method going to the next line.
Picture1 Print FibNext & ", "
FibNumber = FibNumber + FibNext
FibNext = FibNext + FibNumber
Counter = Counter + 2
If Counter = 10 Then
Picture1 Print
‘This creates a new line
End If
Loop
 
Write an IPO chart and the al gorithm in pseudocode and as a flowchart.
 
Activity 12
Write a program that uses nested For loops to fill a 2 dimensional array and then to print
out the times tables from 1 – 12 i nto a picture control using the syntax:
 
picDisplay Print (variable, [variable] ...]
 
with a new line for each new times table on the display.
 
You will definitely need to plot this one out on paper first, writing your algorithms and
checking them.  To declare your variable, you need the statement:
 
Dim arrTables[12,12] As Integer
 
 
 
You will notice that Visual Basic has two different syntax statements for post-test
iterations:
 

Bibliography 
 
Lynch, I (1999). An introduction to Visual Basic. Mansfield, QLD: Lynformation 
 
Further Resources 
Kerman, M. and Brown, R. (2000). Computer programming fundamentals with
applications in Visual Basic 6.0. Reading, Massachusetts: Addison-Wesley.
 
Logged
Pages: [1] Go Up Send this topic Print 
« previous next »
Jump to:  
Get Daily Ayat & Ahadith. To subscribe simply write JOIN ysa1 in sms send it to 8002. for Quotation, Recipes, Joke, Words alerts click here


Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.13 | SMF © 2006-2011, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Page created in 0.146 seconds with 20 queries.