Mr.Khaled Anwar ( )
|
|
- Marilyn Bradley
- 6 years ago
- Views:
Transcription
1 The Rnd() function generates random numbers. Every time Rnd() is executed, it returns a different random fraction (greater than or equal to 0 and less than 1). If you end execution and run the program again, you will notice that it produces the same sequence each time the program is executed. To make the computer produce a different sequence of random numbers each time the program runs, use the function: Randomize() which needs to be executed only once, before the first Rnd() is executed. 1
2 Public Class Form1 Dim A, B, M As Byte Dim R As Single Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Randomize() A = Fix(Rnd() * 13) : B = Fix(Rnd() * 13) Label1.Text = A : Label3.Text = B TextBox1.Clear() : TextBox1.Focus() Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click R = Val(TextBox1.Text) M = A * B If R = M Then MsgBox("Right Answer") Else MsgBox("Wrong Answer... Right Answer " & M) End If 2
3 Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim X, Y, L, H As Single Randomize( ) X = Me.Width - PictureBox1.Width Y = Me.Height - PictureBox1.Height L = Fix(Rnd( ) * X) H = Fix(Rnd( ) * Y) PictureBox1.Left = L PictureBox1.Top = H End Class 3
4 The Timer: It is an invisible stop watch that gives you access to the system clock from the new designed program. By the timer we can make events occur after some interval and without the user intervention. The Timer properties: 1- Interval: Using it the time interval can be set after which the timer starts. This interval ranges from (Zero to 65535) milliseconds milliseconds = 1 second 2- Enabled: It takes the value (True) or (False) and by which we can start or stop the timer. The default of this property is (False) 3- Tick Event: It is the event of the timer and when the timer start after the interval which in interval property. We can write inside the tick event what we want to be executed automatically after an interval. 4
5 The datetime Structure: This structure is in V.B and it contains an extensive list of properties and methods and when declaring a variable of the Date type, then it will be possible to use the properties and methods of this structure. The following table lists some of those properties. Dim S As Date Property Purpose Example Result Now Retrieve system date and time X = Now 10/1/ :06:27 PM Date Date Component X.Date 10/1/2010 Day Day of month (1-31) X.Day 10 DayOfYear Day of year (1-366) X. DayOfYear 10 Hour Hour (0-23) X. Hour 22 Minute Minute (0-59) X. Minute 6 Second Second (0-59) X. Second 27 Month Insert month order through the year (January) X. Month 1 5
6 Method of the (Datetime) Structure: 1- Add Days : Creates a new date value that is specified numbers of days later (Or earlier). 2- Add Hours : Creates a new date value that is specified numbers of hours later (Or earlier). 3- Add Minutes : Creates a new date value that is specified numbers of Minutes later (Or earlier). For Example: Dim H As Date H.AddHours (-3) This statements result in creating a new date that is three hours earlier. 6
7 Public Class Form1 Dim M As Byte Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load M = 0 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Label1.Text = TimeOfDay M = M + 1 If M = 60 Then End 7
8 End Class 8
9 Public Class Form1 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Label1.Text = Now Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Label1.Text = Today Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = TimeOfDay 9
10 End Class 10
11 Public Class Form1 Dim M As Byte Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load M = 0 Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Label1.Text = TimeOfDay M = M + 1 If M = 60 Then End 11
12 End Class 12
13 13
14 Public Class Form1 Dim X As Integer Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick PictureBox1.Left = PictureBox1.Left + 5 If PictureBox1.Left > X - 10 Then Timer1.Enabled = False : Timer2.Enabled = True End If Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load X = Me.Width - PictureBox1.Width Timer1.Enabled = True : Timer2.Enabled = False Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick PictureBox1.Left = PictureBox1.Left - 5 If PictureBox1.Left < 0 Then Timer1.Enabled = True : Timer2.Enabled = False End If End Class 14
15 Public Class Form1 Dim TR As Byte Dim SCORE As Integer Private Sub Button1_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseDown Button1.Image = PictureBox2.Image SCORE = SCORE + 1 Label3.Text = SCORE 15
16 Private Sub Button1_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Button1.MouseUp Button1.Image = PictureBox1.Image Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click Dim K As Byte K = MsgBox("Are you sure?", MsgBoxStyle.YesNo, "Exit") If K = vbyes Then End Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click Dim K As Byte Timer1.Enabled = False K = MsgBox("Do you want to play New Game?", MsgBoxStyle.YesNo, "New Game") If K = vbyes Then Label5.Hide() Button1.Left = 0 : Button1.Top = 0 SCORE = 0 ' Button2.Enabled = False Button3.Enabled = True Button2.Enabled = False TR = 30 Else If TR > 0 Then Timer1.Enabled = True End If Label2.Text = TR 16
17 Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click Button3.Enabled = False Button1.Enabled = True Timer1.Enabled = True Button2.Enabled = True Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick Button1.Left = Rnd() * (Me.Width - Button1.Width) Button1.Top = Rnd() * (Me.Height - Button1.Height) If TR > 0 Then TR = TR - 1 Label2.Text = TR End If If TR = 0 Then Timer1.Enabled = False Button1.Enabled = False Label5.Show() If SCORE <= 30 Then Label5.Text = "Weak" If SCORE > 30 And SCORE < 40 Then Label5.Text = "Pass" If SCORE >= 40 And SCORE < 50 Then Label5.Text = "Good" If SCORE >= 50 And SCORE < 70 Then Label5.Text = "Very Good" If SCORE >= 70 Then Label5.Text = "Excellent" End If Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Randomize() 17
18 Public Class Form1 Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged PictureBox1.Show() Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged PictureBox1.Hide() End Class 18
19 19
20 The reserved word for marks the top of the loop, and the reserved word Next marks its bottom. The counter is a numeric variable that the programmer provides and that the loop uses to count iterations. Start, end, and increment are numeric expressions that the programmer provides. Using the keyword Step is optional. If you omit it, the counter is incremented by one after each repetition, by default. When the computer executes the For statement the first time: The Start numeric value is stored in the variable counter. The value stored in counter is compared to the ending value end, then a) If the counter is greater than end, then the computer exits the loop, and execution resumes at the statement following the reserved word Next. b) If the counter is less than or equal to end, then the computer executes the statements inside the loop from top to bottom. When the computer executes the Next statement, it 1. Increases the value stored in counter by the value of increment. If the keyword Step is omitted, the counter is incremented by Execution goes back to the top of the loop. 20
21 Examples Using the For Net Statement 1- Vary the control variable from 5 to 50 with increments of 2 2-Vary the control variable i from 1 to 100 with increments of 1 For i = 1 To 100 Or For i = 1 To 100 Step 1 3- Vary the control variable i from 10 to 2 with increments of -2 (decrements of 2) For i = 10 To 2 Step Vary the control variable i over the sequence 11, 13, 15, 17, and 19 For i = 11 To 19 Step 2 5- Vary the control variable i over the sequence 49, 42, 35, 28, and 21 For i = 49 To 21 Step -7 21
22 22
23 Public Class Form1 Dim N As Byte Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load TextBox1.Clear() For N = 1 To 10 TextBox1.Text = TextBox1.Text & N & vbcrlf Next Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click TextBox2.Clear() Label2.Text = Button1.Text For N = 1 To 10 Step 2 TextBox2.Text = TextBox2.Text & N & vbcrlf Next Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click TextBox2.Clear() Label2.Text = Button2.Text For N = 2 To 10 Step 2 TextBox2.Text = TextBox2.Text & N & vbcrlf Next End Class 23
24 Each time the computer encounters DO While, it evaluates the condition. If the condition is False, execution skips to the first statement following the reserved word LOOP, as can be seen in Figure 3-2 Figure
25 As long as the condition is True, the computer executes the statements in the body of the loop from top to bottom. The reserved word Loop then causes execution to go back up to the top of the loop where the condition is evaluated again and then either we exit the loop or we execute the statements in the loop seen in Figure 3-3 Figure 3-3 Example (3-1): The code in Figure 3-4 illustrates the Do While Loop, where we need to calculate the sum of all odd integer numbers from 1 to limit where limit is an integer in txtlimit text box. The corresponding user interface is show in the Figure
26 The user interface odd numbers application Figure
27 Public Class Form1 Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Dim W, T As String W = "By" T = "" Do While T < > W T = InputBox("Enter any Name") MsgBox("Welcome " & T) Loop End End Class 27
28 Any system in the universe, whether material or virtual needs to follow main stages to create it or improve its performance, these stages are summarized as follows: 1. Analysis 2. Design 3. Coding 4. Implementation 5. Maintenance You can create any software by following stages of the development of the system (System Development Life Cycle). There are many models that can be used to do so, and now you can use the model in the following figure(1). 28
29 Model (1) The System development Life This model is called "Waterfall Model" The following table shows these stages. Terms Other related terms or activities Analysis Analyze problem and identify system requirements Design OOP design, Structured design Implementation Development, construction, testing, installation Operation Implementation, documentation Maintenance Perform required modifications to cope with evolution & 29
30 development and make data backup copies Q1- Select the appropriate answer of the following: 1 - Follow the steps to solving a specific problem, the first step of the solution are: (identify the problem - determine output - plan the solution ) 2 - Map the flow of flowchart One way to solve the problem of what he called this step: (writing program - documentation of the program - plan the solution) 3 - step in which they are required to write code in one of the computer languages are: (write a program to - test and debug the program - identify inputs) 4 - Step by step pre-test and debug the program while solving a problem are: (closer to the program - write a program - determine output) 5 - Last step of solving the problem are: (deviate output - Write the program - documenting the program) 6 - The first phase of the main stages of the work of any system or improvement in the performance stage is: (Design - Implementation - Analysis) 7 - The last phase of the main stages of the work system, oh no improvement in the performance are: 30
31 (Analysis - Implementation - Maintenance) 8 - Run the program and enter the necessary data and test results and then the program is documented in this phase: (Implementation - Coding - Design) 9 - A study of the problem at hand and know the system requirements in this phase: (Analysis - Implementation - Coding) 10 - To develop a method for the work of any system, in that phase: (Coding - Design - Implementation) 11 - Of the tools used in the implementation of a set of commands automatically after a certain period of time is the tool: (Text Box - Timer - ComboBox) 12 - A set of instructions can be executed within the procedure Timer - tick after a certain period of time to be determined characteristic: (Interval - Enabled - Name) 13 - The result of command execution (time of day) Msg box gives: (the current time - the current date - current date and time) 14 - The result of command execution (Today) Msg Box given: (to the current date - the comment - current date and time) 15 - Can be found by using a random number function: ( Interval - Rnd - Year) 16 - When you use the conditional sentence If.. then.. else if the condition is met, which between If and Then are executed 31
32 (phrases Then after that - sentences else after that - before phrases If) 17 - When you use the conditional sentence If.. then.. else if the condition is not met, which between If and Then are executed: (phrases Then after that - sentences else after that - before phrases If) 18 - In the sentence "Clock" = me.text been using the property: (me - Text - clock) 19 - In the sentence "timer" = me.text been using the property: (me - Text - clock) 20 - After the implementation of the sentence Button 1. Enabled = false becomes the object Button1: (not available for use - vanished - available for use) Q2. Put ( ) or (X) 1 - select the input or step of the solution to the problem ( ) 2 - Defining the problem, first step of solving any problem ( ) 3 - Step by step followed by select inputs determine the output during the solution of any problem ( ) 4 - Step writing program last step of solving any problem ( ) 5 - A step closer the program, last step of solving any problem ( ) 6 - To develop a method followed by step writing program while 32
33 solving any problem ( ) 7 - Step test and debug the program followed by step writing program while solving the problem ( ) 8 - Maps flow one way to solve the problem ( ) 9 - Humor is the first analysis of the key stages of the establishment of this system or the improvement in performance ( ) 10 - In the maintenance phase is the last key stages of the establishment of any system or improvement in performance ( ) 11 - At the stage of documenting the program is correct and test the program( ) 12 - In the implementation phase of the program is run and the introduction of the necessary data and then test the results then are documented program ( ) 13 - In the design stage is to run the program and enter the necessary data and test output ( ) 14 - The program is written using the language of the computer in the appropriate phase code while solving the problem ( ) 15 - Maintenance phase precedes the design phase in the initial stages of the establishment of any system ( ) 33
34 Q.3- Complete Youssef wanted to calculate area of a circle so h wrote the following program: Const Pi As Single = 3.14 Dim R As Single Dim Area As Double R = 1000 Area = Pi * R * R MsgBox( Area ) 1. Youssef used the numeric variable R of type.. to store the value 2. He used also numeric constant.. of the data type single to store the value Youssef used the numeric variable. of data type...to store.. which is equal to Pi*R Numeric variable was declared using the keyword (Dim), the constant Pi was declared using the keyword... 34
35 Q.4 - Choose the correct answer: (Dim, Const, String, Single) 1. Khaled wanted to calculate total grade of a student so he declared numeric variables using the word. 2. He used a variable of data type... To store student name. 3. He used a variable of data type. to store the total grade. Q5. : Put ( ) or ( ) 1-Add It's possible to control the intervals of the "Timer" firing through the "Interval property" ( ) 2-One second is equal 100 milliseconds ( ) 3-The determined interval in " Interval property " ranges from (zero, 6500) milliseconds ( ) 4-By " Enabled " property of the timer the "Timer" runs or stops it after putting it on the "Form window" ( ) 5-When "Enable property" takes "True" value, this prevents "Tick event" from occurring and stops the "Timer" ( ) 6-To control " Enable property " and give it (True or False) values, that should be during designing and that can't be controlled during running ( ) 7- To use (DateTime) structure and its properties and method we should first declare a variable of the Date type. ( ) 35
36 Q6- What is the term which the following sentences indicate: 1- It is a property which means the duration in which the timer is activated and when it is activated Tick event occurs. 36 (..) 2- An event of the timer and it occurs when activating (starting) the timer and we write inside the statements which need to be executed after on interval. 3- An invisible object which helps us in our dealing with the operating system clock. (..) (..) 4- It has a number of properties and methods which control the time and they may be used when declaring a variable of the Date type. (..) Q7- Choose from the second column the suitable for the first column: Column (1) Column (2) 1 Second ( ) A Insert the Month order during the year. 2 Day ( ) B Insert the current second. 3 Now (.) C Insert the Day order during the year. 4 Minutes ( ) D Insert the current minute. 5 Date ( ) E Insert the Day order during the month. 6 Month (.) F Occurs after the specified interval and the statements in it are executed. 7 Enabled ( ) G Insert the current date and time. Responsible for determining the duration after 8 Tick ( ) H which the timer starts and is measure with the millisecond 9 DateOfYear(.) J Insert the current Date. 10 Interval ( ) K For starting or stopping the timer.
37 Q8. : Multiple choices Question:- 1- Timer property Interval sets the rate at Tick events occur in a) Seconds b) Milliseconds c) Minute d) Hour 2- Timer property Interval property sets the rate at which tick events occur in a. Second b. Minute. c. Millisecond. d. Hour 3- If Interval value is 3000, then its value in seconds is: a. 3 b. 30 c d The.. structure retrieves your computer s date and time. a. Current Time b. Time c. Now d. DateTime 5- You can. To a date variable. a. Add day s b. Add hour s c. Subtract days d. All of the above 6- To subtract one day from Date variable X, assign the value returned by.. to X. a. X.AddHours (-24) b. X.SubtractDays c. X.AddHours (-1) 37
38 d. a and c Q9. Choose the correct answer for each one of the following: 1- In For Next statement, the number of repetition in For X=1 to 8 step 3 is (a) 3 (b) 4 (c) 2 (d) 1 2- The property Interval for the (Timer) sets the rate at which the event occurs in (a) Second. (c) Millisecond. (b) Minute. (d) Hour. 3 - We can stop the timer by giving the property the value false (a) Interval. (c) Modifiers (b) Enabled. (d) Tag 4- The Numeric Variable which takes integer numbers from 0 to 255 is.. (a) Integer. (c) Byte. (b) String. (d) Double. 38
39 Q10.Complete the following statements from the words between brackets: 1- To prevent the (Timer1) from running, you write the command " Timer1.enabled =.. " ) True False End ) 2- In (If Then Else ) statement, when the outcome of the condition is evaluated to be. then the statements following (Else) are executed ) True False Null ) 3- You can find out the date and time in the computer by executing the command MsgBox ( ) ) Now Time DateTime ) 4- To delete all items from the object (listbox1), we use the method... ) Remove Clear Delete ) Q11. Complete the following statements from the words between brackets. (Dim Const String - Single - Class Object) Khaled wants to write program codes to compute the total degrees of a student in all subjects, and 1-he uses numerical variable of type Single which is declared by the term ( ) 2-he uses also a variable type ( ) to store student name value. 39
40 3-he uses a variable of type ( ) to store the total degrees of the student in all subjects. Q12. A) Read the following instructions Dim Age, Mark, Total As Single Age = 25.5 Mark = 90 If Age < 26 Then Age = 16 Mark=100 End If Total = Mark * 2 B) Execute the previous instructions,then choose the correct answers from the following: 1. The value of the variable "Age" is: a b -90 c The value of the variable "Mark" is: a 90 b-100 c The result of the condition Age < 26 : a 25.5 b- True c-false 40
41 4. The value of the variable "Total" is: a 200 b- 180 c- 190 Q13-Put a tick ( ) in front of the true sentence and a cross (X) in front of the wrong sentence: 1- The variable name "Spent_Money" is a valid name in terms of rules of naming variables. ( ) 2- The For Next Loop is used when we know in advance the number of iterations of the loop. ( ) 3-In a program, lines that begin with ('), are considered comments within the program code. ( ) 4-Variable of type Double is used to store integers only ( ) 5-To clear the ListBox control from all items, the method Remove (text) is used. ( ) Q14 a- Read the following code: Dim X, Y, Z As Integer X = 2 Y = 3 Z = 4 MsgBox ( Y^X * X + Z * 3 ) 41
42 And then type the result of the execution :... b- Read the following code: Dim X, C As Integer X = 4 For C = 0 To 7 Step 3 X = X * 2 Next MsgBox ( X ) What is the value of x in the message box?... Q15-Write the scientific term for each phrase of the following statements: A- Method used to delete all items of the ListBox control is (...). B- Tool that allows programmers to divide a number of RadioButtons and CheckBoxes into different groups. (...). 42
43 C- Tool that allows you to create or display a list of items (...). Q.16: Match from the First column with the suitable in the second column: From the properties of Check Box Property Function 1 Appearance (.) 1 Set the width of the control 2 Width (.) 2 Changes the button from into the default 3 Enabled (.) 3 Sets and puts image on the control 4 Image (.) 4 Determines whether to choose the control or not (True or False) 5 Checked (.) 5 Runs or stops the control Q.17: Put ( ) or (X) 1- To store a numeric statement in a variable, this variable could be named (1 Number) ( ) 2- Colors are from the examples of the intrinsic constants in VB. ( ) 43
44 3- Byte means the equal sized bytes which determine the size of the computer memory ( ) 4- Interval property of the timer determines the average of tick event of the occurrence and the value of this property could be measured by minutes( ) The compound condition And takes the true value if one of the conditions is True and not both of them ( ) Q18. : Choose the correct answer: 1- Giving that X = 3, Y = 2, then the result of (X ^ Y + 3 * 2) is. ( ) 2- To remove all the items in the Listbox, use the method. (Clear Delete remove) 3- You can add by. An item in the end of the program, (Add Insert Count) 4- The code.. is used for the integer division. ( Mod - \ - / ) 44
Else. End If End Sub End Class. PDF created with pdffactory trial version
Dim a, b, r, m As Single Randomize() a = Fix(Rnd() * 13) b = Fix(Rnd() * 13) Label1.Text = a Label3.Text = b TextBox1.Clear() TextBox1.Focus() Private Sub Button2_Click(ByVal sender As System.Object, ByVal
More informationChapter 1: Representing Data
- ١ - Chapter 1: Representing Data Data Variables and Constants When you input data into a computer, the computer stores it in its memory 1- Computer's memory consider as millions of little boxes. 2- Each
More informationS.2 Computer Literacy Question-Answer Book
S.2 C.L. Half-yearly Examination (2012-13) 1 12-13 S.2 C.L. Question- Answer Book Hong Kong Taoist Association Tang Hin Memorial Secondary School 2012-2013 Half-yearly Examination S.2 Computer Literacy
More informationUnit 7. Lesson 7.1. Loop. For Next Statements. Introduction. Loop
Loop Unit 7 Loop Introduction So far we have seen that each instruction is executed once and once only. Some time we may require that a group of instructions be executed repeatedly, until some logical
More informationUnit 3. Lesson Designing User Interface-2. TreeView Control. TreeView Contol
Designing User Interface-2 Unit 3 Designing User Interface-2 Lesson 3.1-3 TreeView Control A TreeView control is designed to present a list in a hierarchical structure. It is similar to a directory listing.
More informationVISUAL BASIC II CC111 INTRODUCTION TO COMPUTERS
VISUAL BASIC II CC111 INTRODUCTION TO COMPUTERS Intended Learning Objectives Able to build a simple Visual Basic Application. 2 The Sub Statement Private Sub ControlName_eventName(ByVal sender As System.Object,
More informationRevision for Final Examination (Second Semester) Grade 9
Revision for Final Examination (Second Semester) Grade 9 Name: Date: Part 1: Answer the questions given below based on your knowledge about Visual Basic 2008: Question 1 What is the benefit of using Visual
More informationIn this tutorial we will create a simple calculator to Add/Subtract/Multiply and Divide two numbers and show a simple message box result.
Simple Calculator In this tutorial we will create a simple calculator to Add/Subtract/Multiply and Divide two numbers and show a simple message box result. Let s get started First create a new Visual Basic
More informationDO NOT COPY AMIT PHOTOSTUDIO
AMIT PHOTOSTUDIO These codes are provided ONLY for reference / Help developers. And also SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUERMENT FOR THE AWARD OF BACHELOR OF COMPUTER APPLICATION (BCA) All rights
More informationProgramming with Visual Studio Higher (v. 2013)
Programming with Visual Studio Higher (v. 2013) Contents/Requirements Checklist Multiple selection: using ifs & case While Loops Using arrays Filling arrays Displaying array contents Types of variables:
More informationIMS1906: Business Software Fundamentals Tutorial exercises Week 5: Variables and Constants
IMS1906: Business Software Fundamentals Tutorial exercises Week 5: Variables and Constants These notes are available on the IMS1906 Web site http://www.sims.monash.edu.au Tutorial Sheet 4/Week 5 Please
More informationObjectives. After completing this topic, the students will: Understand of the concept of polymorphism Know on How to implement 2 types of polymorphism
Polymorphism Objectives After completing this topic, the students will: Understand of the concept of polymorphism Know on How to implement 2 types of polymorphism Definition Polymorphism provides the ability
More informationPrivate Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click Label1.Text = Label1.
練習問題 1-1 Label1 Label1.Text = Label1.Text + 2 練習問題 1-2 Button2 Label1 Label1.Text = Label1.Text+ 2 Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
More informationTo enter the number in decimals Label 1 To show total. Text:...
Visual Basic tutorial - currency converter We will use visual studio to create a currency converter where we can convert a UK currency pound to other currencies. This is the interface for the application.
More informationA Complete Tutorial for Beginners LIEW VOON KIONG
I A Complete Tutorial for Beginners LIEW VOON KIONG Disclaimer II Visual Basic 2008 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been
More information超音波モータ制御プログラムの作成 (v1.2.1)
超音波モータ制御プログラムの作成 (v1.2.1) 2008 年 11 月 28 日 Masaaki MATSUO 構成機器 モータ本体 : フコク ロータリーエンコーダー内蔵型超音波モータ USB-60E モータ制御部 : フコク 位置決制御ドライバ DCONT-3-60 (SD13) コントローラ : Interface 2 軸絶縁パルスモーションコントローラ ( 直線補間エンコーダ入力 5V)
More informationLearning VB.Net. Tutorial 10 Collections
Learning VB.Net Tutorial 10 Collections Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you enjoy it.
More informationForm Connection. Imports System Imports System.Threading Imports System.IO.Ports Imports System.ComponentModel
Form Connection Imports System Imports System.Threading Imports System.IO.Ports Imports System.ComponentModel Public Class connection '------------------------------------------------ Dim myport As Array
More informationUnit 4. Lesson 4.1. Managing Data. Data types. Introduction. Data type. Visual Basic 2008 Data types
Managing Data Unit 4 Managing Data Introduction Lesson 4.1 Data types We come across many types of information and data in our daily life. For example, we need to handle data such as name, address, money,
More informationRepetition Structures
Repetition Structures There are three main structures used in programming: sequential, decision and repetition structures. Sequential structures follow one line of code after another. Decision structures
More informationRadius= 10 cm, Color= Red, Weight= 200g, X= 3m, Y= 5m, Z= 2m. Radius= 10 cm, Color= Blue, Weight= 200g, X= 3m, Y= 5m, Z= 0m
C# property method Radius= 10 cm, Color= Red, Weight= 200g, X= 3m, Y= 5m, Z= 0m Radius= 10 cm, Color= Red, Weight= 200g, X= 3m, Y= 5m, Z= 2m Radius= 10 cm, Color= Blue, Weight= 200g, X= 3m, Y= 5m, Z= 0m
More informationMy first game. 'function which adds objects with bug tag to bugarray array. Saturday, November 23, :06 AM
My first game Saturday, November 23, 2013 5:06 AM Public Class Form1 Dim moveright As Boolean = False Dim moveup As Boolean = False Dim moveleft As Boolean = False Dim movedown As Boolean = False Dim score
More informationVisual Basic: Opdracht Structuur
Visual Basic: Opdracht Structuur HoofdMenu.vb SubMenu_Kwadraat.vb Form1.vb Form2.vb Submenu_Som.vb Form3.vb Form4.vb SubMenu_Gem.vb Form5.vb Form6.vb Form10.vb SubMenu_Naam.vb Form7.vb Form11.vb Form8.vb
More informationComputing Science Unit 1
Computing Science Unit 1 Software Design and Development Programming Practical Tasks Business Information Technology and Enterprise Contents Input Validation Find Min Find Max Linear Search Count Occurrences
More informationโปรแกรมช วยทดสอบหม อแปลงกระแส
โปรแกรมช วยทดสอบหม อแปลงกระแส 1.เมน ของโปรแกรม ภาพท 1 หน าเมน ของโปรแกรม Public Class frmmain Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
More informationComputer Net Revision
First:In the following Form window, if it is required to store entries from the user in variables. Define the corresponding Data Type for each input. 1. 2. 3. 4. 1 2 3 4 1- Less number of bytes means more
More informationDRAWING AND MOVING IMAGES
DRAWING AND MOVING IMAGES Moving images and shapes in a Visual Basic application simply requires the user of a Timer that changes the x- and y-positions every time the Timer ticks. In our first example,
More informationFOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources
FOR 240 Homework Assignment 4 Using DBGridView and Other VB Controls to Manipulate Database Introduction to Computing in Natural Resources This application demonstrates how a DataGridView control can be
More information(0,0) (600, 400) CS109. PictureBox and Timer Controls
CS109 PictureBox and Timer Controls Let s take a little diversion and discuss how to draw some simple graphics. Graphics are not covered in the book, so you ll have to use these notes (or the built-in
More informationDisclaimer. Trademarks. Liability
Disclaimer II Visual Basic 2010 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft
More informationLearning VB.Net. Tutorial 19 Classes and Inheritance
Learning VB.Net Tutorial 19 Classes and Inheritance Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you
More informationAdd Subtract Multiply Divide
ARITHMETIC OPERATORS if AND if/else AND while LOOP Order of Operation (Precedence Part 1) Copyright 2014 Dan McElroy Add Subtract Multiply Divide + Add - Subtract * Multiply / Divide = gives the quotient
More informationSystem Analysis and Design
System Analysis and Design LAB RECORD-INFS -280/L Information Systems Department University of Nizwa, Sultanate of Oman Table of Contents Task. No: Title Page Nos. Date 1) VB Text box and Message Button
More informationFinal Exam 7:00-10:00pm, April 14, 2008
Name:, (last) (first) Student Number: Section: Instructor: _P. Cribb_ L. Lowther_(circle) York University Faculty of Science and Engineering Department of Computer Science and Engineering Final Exam 7:00-10:00pm,
More information: CREATING WEB BASED APPLICATIONS FOR INSTRUMENT DATA TRANSFER USING VISUAL STUDIO.NET
2006-938: CREATING WEB BASED APPLICATIONS FOR INSTRUMENT DATA TRANSFER USING VISUAL STUDIO.NET David Hergert, Miami University American Society for Engineering Education, 2006 Page 11.371.1 Creating Web
More informationSection 7 The BASIC Language II
Dates Section 7 The BASIC Language II The Date class holds a date (between January 1 st, 0001 and December 31 st, 9999) combined with a time (between 0:00:00 and 23:59:59) Constructors of the Date class
More informationVARIABLES. Aim Understanding how computer programs store values, and how they are accessed and used in computer programs.
Lesson 2 VARIABLES Aim Understanding how computer programs store values, and how they are accessed and used in computer programs. WHAT ARE VARIABLES? When you input data (i.e. information) into a computer
More informationInteracting with External Applications
Interacting with External Applications DLLs - dynamic linked libraries: Libraries of compiled procedures/functions that applications link to at run time DLL can be updated independently of apps using them
More informationCALIFORNIA STATE UNIVERSITY, SACRAMENTO College of Business Administration. MIS 15 Introduction to Business Programming. Programming Assignment 3 (P3)
CALIFORNIA STATE UNIVERSITY, SACRAMENTO College of Business Administration MIS 15 Introduction to Business Programming Programming Assignment 3 (P3) Points: 50 Due Date: Tuesday, May 10 The purpose of
More informationVARIABLES. 1. STRINGS Data with letters and/or characters 2. INTEGERS Numbers without decimals 3. FLOATING POINT NUMBERS Numbers with decimals
VARIABLES WHAT IS A VARIABLE? A variable is a storage location in the computer s memory, used for holding information while the program is running. The information that is stored in a variable may change,
More informationVB.NET Programs. ADO.NET (insert, update, view records)
ADO.NET (insert, update, view records) VB.NET Programs Database: Student Table : Studtab (adno, name, age, place) Controls: DataGridView, Insert button, View button, Update button, TextBox1 (for Admission
More informationForm Adapter Example. DRAFT Document ID : Form_Adapter.PDF Author : Michele Harris Version : 1.1 Date :
Form Adapter Example DRAFT Document ID : Form_Adapter.PDF Author : Michele Harris Version : 1.1 Date : 2009-06-19 Form_Adapter.doc DRAFT page 1 Table of Contents Creating Form_Adapter.vb... 2 Adding the
More informationOverview About KBasic
Overview About KBasic The following chapter has been used from Wikipedia entry about BASIC and is licensed under the GNU Free Documentation License. Table of Contents Object-Oriented...2 Event-Driven...2
More informationSerial-out Color Sensor. Overview. Features
Visit us @ www.thearyatechnologies.com Email: aryaprotech@gmail.com / info@thearyatechnologies.com Contact us@ 0253-2512131 Serial-out Color Sensor Overview Color sensor identifies primary colors (Red,
More informationProgramming for Engineers Iteration
Programming for Engineers Iteration ICEN 200 Spring 2018 Prof. Dola Saha 1 Data type conversions Grade average example,-./0 class average = 23450-67 893/0298 Grade and number of students can be integers
More informationDecision Structures. Start. Do I have a test in morning? Study for test. Watch TV tonight. Stop
Decision Structures In the programs created thus far, Visual Basic reads and processes each of the procedure instructions in turn, one after the other. This is known as sequential processing or as the
More information1 Information system An information system is the combination of technology(computers) and people that enable an organization to collect data, store them, and transform them into information Data Data
More informationVB FUNCTIONS AND OPERATORS
VB FUNCTIONS AND OPERATORS In der to compute inputs from users and generate results, we need to use various mathematical operats. In Visual Basic, other than the addition (+) and subtraction (-), the symbols
More informationLab 3 The High-Low Game
Lab 3 The High-Low Game LAB GOALS To develop a simple windows-based game named High-Low using VB.Net. You will use: Buttons, Textboxes, Labels, Dim, integer, arithmetic operations, conditionals [if-then-else],
More informationDeveloping Student Programming and Problem-Solving Skills With Visual Basic
t e c h n o l o g y Del Siegle, Ph.D. Developing Student Programming and Problem-Solving Skills With Visual Basic TThree decades have passed since computers were first introduced into American classrooms.
More informationNow find the button component in the tool box. [if toolbox isn't present click VIEW on the top and click toolbox]
C# Tutorial - Create a Tic Tac Toe game with Working AI This project will be created in Visual Studio 2010 however you can use any version of Visual Studio to follow along this tutorial. To start open
More information"!#... )*! "!# )+, -./ 01 $
Email engauday@hotmail.com! "!#... $ %&'... )*! "!# )+, -./ 01 $ ) 1+ 2#3./ 01 %.. 7# 89 ; )! 5/< 3! = ;, >! 5 6/.?
More informationDisclaimer. Trademarks. Liability
Disclaimer II Visual Basic 2010 Made Easy- A complete tutorial for beginners is an independent publication and is not affiliated with, nor has it been authorized, sponsored, or otherwise approved by Microsoft
More informationMember Management System
Member Management System These codes are provided ONLY for reference / Help developers. And also SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUERMENT FOR THE AWARD OF BACHELOR OF COMPUTER APPLICATION (BCA)
More informationPROGRAMMING ASSIGNMENT: MOVIE QUIZ
PROGRAMMING ASSIGNMENT: MOVIE QUIZ For this assignment you will be responsible for creating a Movie Quiz application that tests the user s of movies. Your program will require two arrays: one that stores
More informationYear 12 : Visual Basic Tutorial.
Year 12 : Visual Basic Tutorial. STUDY THIS Input and Output (Text Boxes) The three stages of a computer process Input Processing Output Data is usually input using TextBoxes. [1] Create a new Windows
More informationTutorial 03 understanding controls : buttons, text boxes
Learning VB.Net Tutorial 03 understanding controls : buttons, text boxes Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple
More informationBASIC COMPUTATION. public static void main(string [] args) Fundamentals of Computer Science I
BASIC COMPUTATION x public static void main(string [] args) Fundamentals of Computer Science I Outline Using Eclipse Data Types Variables Primitive and Class Data Types Expressions Declaration Assignment
More informationWEEK 1. Event: Tick: Occurs when the specified timer interval has elapsed and the timer is enabled.
WEEK 1 Timer: A Timer is used to raise an event at user-defined intervals. It is optimized for use in Windows Forms applications. Timer is used to control and manage events that are time related. For example:
More informationRepetition Structures
Repetition Structures Chapter 5 Fall 2016, CSUS Introduction to Repetition Structures Chapter 5.1 1 Introduction to Repetition Structures A repetition structure causes a statement or set of statements
More informationCondition-Controlled Loop. Condition-Controlled Loop. If Statement. Various Forms. Conditional-Controlled Loop. Loop Caution.
Repetition Structures Introduction to Repetition Structures Chapter 5 Spring 2016, CSUS Chapter 5.1 Introduction to Repetition Structures The Problems with Duplicate Code A repetition structure causes
More informationChapter 4: Control structures. Repetition
Chapter 4: Control structures Repetition Loop Statements After reading and studying this Section, student should be able to Implement repetition control in a program using while statements. Implement repetition
More informationAssoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.
Assoc. Prof. Dr. Marenglen Biba (C) 2010 Pearson Education, Inc. All for repetition statement do while repetition statement switch multiple-selection statement break statement continue statement Logical
More informationLab 4: Adding a Windows User-Interface
Lab 4: Adding a Windows User-Interface In this lab, you will cover the following topics: Creating a Form for use with Investment objects Writing event-handler code to interact with Investment objects Using
More informationLecture 10 OOP and VB.Net
Lecture 10 OOP and VB.Net Pillars of OOP Objects and Classes Encapsulation Inheritance Polymorphism Abstraction Classes A class is a template for an object. An object will have attributes and properties.
More informationUpgrading Applications
C0561587x.fm Page 77 Thursday, November 15, 2001 2:37 PM Part II Upgrading Applications 5 Your First Upgrade 79 6 Common Tasks in Visual Basic.NET 101 7 Upgrading Wizard Ins and Outs 117 8 Errors, Warnings,
More informationPROBLEM SOLVING WITH LOOPS. Chapter 7
PROBLEM SOLVING WITH LOOPS Chapter 7 Concept of Repetition Structure Logic It is a computer task, that is used for Repeating a series of instructions many times. Ex. The Process of calculating the Total
More informationUNIT 2 USING VB TO EXPAND OUR KNOWLEDGE OF PROGRAMMING
UNIT 2 USING VB TO EXPAND OUR KNOWLEDGE OF PROGRAMMING UNIT 2 USING VB TO EXPAND OUR KNOWLEDGE OF PROGRAMMING... 1 IMPORTANT PROGRAMMING TERMINOLOGY AND CONCEPTS... 2 Program... 2 Programming Language...
More informationLoops and Files. Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz
Loops and Files Chapter 04 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz Chapter Topics o The Increment and Decrement Operators o The while Loop o Shorthand Assignment Operators o The do-while
More informationIntroduction. C provides two styles of flow control:
Introduction C provides two styles of flow control: Branching Looping Branching is deciding what actions to take and looping is deciding how many times to take a certain action. Branching constructs: if
More informationChapter 4: Control structures
Chapter 4: Control structures Repetition Loop Statements After reading and studying this Section, student should be able to Implement repetition control in a program using while statements. Implement repetition
More informationYou will have mastered the material in this chapter when you can:
CHAPTER 6 Loop Structures OBJECTIVES You will have mastered the material in this chapter when you can: Add a MenuStrip object Use the InputBox function Display data using the ListBox object Understand
More informationAn overview about DroidBasic For Android
An overview about DroidBasic For Android from February 25, 2013 Contents An overview about DroidBasic For Android...1 Object-Oriented...2 Event-Driven...2 DroidBasic Framework...2 The Integrated Development
More informationOVERLOADING METHODS AND CONSTRUCTORS: The Ball Class
OVERLOADING METHODS AND CONSTRUCTORS: The Ball Class Create a Ball Demo program that uses a Ball class. Use the following UML diagram to create the Ball class: Ball - ballcolor: Color - ballwidth, ballheight:
More information5.1. Chapter 5: The Increment and Decrement Operators. The Increment and Decrement Operators. Looping. ++ is the increment operator.
Chapter 5: Looping 5.1 The Increment and Decrement Operators Copyright 2009 Pearson Education, Inc. Copyright Publishing as Pearson 2009 Addison-Wesley Pearson Education, Inc. Publishing as Pearson Addison-Wesley
More informationChapter 4 The If Then Statement
The If Then Statement Conditional control structure, also called a decision structure Executes a set of statements when a condition is true The condition is a Boolean expression For example, the statement
More informationก Microsoft Visual Studio 2008
ก 58 ก ก ก ก ก 58 59 ก Microsoft Visual Studio 2008 1. DVD ก MSVS2008 ก MSVS2008 ก ก MSVS2008 ก ก 180 DVD DVD ก MSVS2008 ก ก Install Visual Studio 2008 2. ก ก ก ก ก Next 3. ก ก Options Page ก Custom ก
More informationChapter 3 Problem Solving and the Computer
Chapter 3 Problem Solving and the Computer An algorithm is a step-by-step operations that the CPU must execute in order to solve a problem, or to perform that task. A program is the specification of an
More informationLearning VB.Net. Tutorial 17 Classes
Learning VB.Net Tutorial 17 Classes Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you enjoy it. If
More informationVISUAL BASIC 2005 EXPRESS: NOW PLAYING
VISUAL BASIC 2005 EXPRESS: NOW PLAYING by Wallace Wang San Francisco ADVANCED DATA STRUCTURES: QUEUES, STACKS, AND HASH TABLES Using a Queue To provide greater flexibility in storing information, Visual
More informationC-LANGUAGE CURRICULAM
C-LANGUAGE CURRICULAM Duration: 2 Months. 1. Introducing C 1.1 History of C Origin Standardization C-Based Languages 1.2 Strengths and Weaknesses Of C Strengths Weaknesses Effective Use of C 2. C Fundamentals
More informationLanguage Fundamentals
Language Fundamentals VBA Concepts Sept. 2013 CEE 3804 Faculty Language Fundamentals 1. Statements 2. Data Types 3. Variables and Constants 4. Functions 5. Subroutines Data Types 1. Numeric Integer Long
More informationChapter 1: Problem Solving Skills Introduction to Programming GENG 200
Chapter 1: Problem Solving Skills Introduction to Programming GENG 200 Spring 2014, Prepared by Ali Abu Odeh 1 Table of Contents Fundamentals of Flowcharts 2 3 Flowchart with Conditions Flowchart with
More informationLecture 7 Tao Wang 1
Lecture 7 Tao Wang 1 Objectives In this chapter, you will learn about: Interactive loop break and continue do-while for loop Common programming errors Scientists, Third Edition 2 while Loops while statement
More informationIndividual research task. You should all have completed the research task set last week. Please make sure you hand it in today.
Lecture 6 Individual research task. You should all have completed the research task set last week. Please make sure you hand it in today. Previously Decision structures with flowcharts Boolean logic UML
More informationControl Statements: Part 1
4 Let s all move one place on. Lewis Carroll Control Statements: Part 1 The wheel is come full circle. William Shakespeare How many apples fell on Newton s head before he took the hint! Robert Frost All
More informationAn InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is
InputBox( ) Function An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is A = InputBox ( Question or Phrase, Window Title, ) Example1: Integer:
More informationo Counter and sentinel controlled loops o Formatting output o Type casting o Top-down, stepwise refinement
Last Time Let s all Repeat Together 10/3/05 CS150 Introduction to Computer Science 1 1 We covered o Counter and sentinel controlled loops o Formatting output Today we will o Type casting o Top-down, stepwise
More informationQuick Reference Guide
SOFTWARE AND HARDWARE SOLUTIONS FOR THE EMBEDDED WORLD mikroelektronika Development tools - Books - Compilers Quick Reference Quick Reference Guide with EXAMPLES for Basic language This reference guide
More informationMultiple Choice (Questions 1 13) 26 Points Select all correct answers (multiple correct answers are possible)
Name Closed notes, book and neighbor. If you have any questions ask them. Notes: Segment of code necessary C++ statements to perform the action described not a complete program Program a complete C++ program
More informationVBA Collections A Group of Similar Objects that Share Common Properties, Methods and
VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously
More informationCOPYRIGHTED MATERIAL. Taking Web Services for a Test Drive. Chapter 1. What s a Web Service?
Chapter 1 Taking Web Services for a Test Drive What s a Web Service? Understanding Operations That Are Well Suited for Web Services Retrieving Weather Information Using a Web Service 101 Retrieving Stock
More informationvariables programming statements
1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: 0-9730824-9-6 Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual
More informationCheck out the demo video of this application so you know what you will be making in this tutorial.
Visual Basic - System Information Viewer Welcome to our special tutorial of visual basic. In this tutorial we will use Microsoft visual studio 2010 version. You can download it for free from their website.
More informationHigher Computing Science Software Design and Development - Programming Summary Notes
Higher Computing Science Software Design and Development - Programming Summary Notes Design notations A design notation is the method we use to write down our program design. Pseudocode is written using
More informationLearning VB.Net. Tutorial 15 Structures
Learning VB.Net Tutorial 15 Structures Hello everyone welcome to vb.net tutorials. These are going to be very basic tutorials about using the language to create simple applications, hope you enjoy it.
More information3 The L oop Control Structure
3 The L oop Control Structure Loops The while Loop Tips and Traps More Operators The for Loop Nesting of Loops Multiple Initialisations in the for Loop The Odd Loop The break Statement The continue Statement
More informationFlow Control Continued
Flow Control Continued fn deleteallskinmodifiers mrgvis_geoonly= ( all_obj = #() max modify mode while all_obj.count > 0 do deleteitem all_obj 1 if mrgvis_geoonly then ( max select all ) else ( select
More informationAppendix 1: Pseudo-code command set
Appendix 1: Pseudo-code command set Questions in the written examination that involve code will use this pseudo-code for clarity and consistency. However, students may answer questions using any valid
More informationCOMS 469: Interactive Media II
COMS 469: Interactive Media II Agenda Review Data Types & Variables Decisions, Loops, and Functions Review gunkelweb.com/coms469 Review Basic Terminology Computer Languages Interpreted vs. Compiled Client
More information