ELS language SchoolComputer Department 3rd prep Computer Exam

Name: ------class: ------

General revision term2 (year 2017)

First:Put True OR False and correct the wrong:

  1. The Variables of types (Single & Double) are used to store integers only. ( )
  2. The using of (Else) keyword is optional in If statement.( )
  3. The (Select…Case) statement is used if there are more than two possible branches.( )
  4. Logical error happens when user inputs numerical datatype instead of character datatype.( )
  5. VB.net allows the (Implicit Conversion) in assignment statement if the value assigned in the right side is compatible with the data type of variable in the left side. ( )
  6. Variables and constants cannot be used except in the scope of their declaration.( )
  7. The function IsNumeric () is used to check if the value is numeric and returns true or not so it returns false. ( )
  8. In (IF) statement the code that follows (Then) is executed when the result of the conditional expression is (False). ( )
  9. Rem is the Keyword used to add comments inside the code window.( )
  10. One of the ways to Prevent the Runtime Errors is using (Try….Catch) statement( )
  11. In case the value of keyword Step in (For .. Next) loop takes zero, the loop will repeated infinite number of repetition and never stops. ( )
  12. Anonymity is a form of cyber bullying. ( )
  13. Const B_ As Date = 7/2/1977 is the correct declaration for a constant . ( )
  14. In ( For ..next )looping statement the keyword step is a must. ( )
  15. You can use a variable of type( Byte) to store the value (400) ( )

Second : Choose the correct answer:

  1. ------is the property that displays the item in (ListBox) control.

( Checked –- Items - Text )

  1. ------data type is used to store the logical value (true /false) .

( Char – Date - Boolean - Integer )

  1. The result of the following arithmetic operation: 10*5 - (4+3 ) ^ 2is------.

( 22 – 0 - 20 - 1 )

  1. ------is the mathematical operator that computes the remainder of the division expression.

( ^ – / - + - Mod)

  1. One of these variable names is invalid in Visual Basic.net

( UserAddress2 – User_Address - User@Address - none of the previous)

  1. (Focus)is a ------for the TextBox that used to set the cursor focus inside the TextBox.

( Property – Method - Control )

  1. The reserved word ------is used to create a new line.

(VbCrLf – Me - Dim - Underscore_ )

  1. The branching ------statement is used to check more than one conditional expression on one variable:

[(IF …. Then) – (IF…. Then ….Else)– (Select ….Case)]

  1. The error in this line of code :( Dem x as short) is considered a ------

( Syntax Error – Logical Error- Runtime Error – All the previous)

  1. The storage space in memory is occupied by the data type (Integer) is------

( 1 Bytes – 2Bytes - 3 Bytes - 4 Bytes )

  1. It is a publication of hostile and vulgar words against one or more through a media and electronic communication.

( Harassment – Stalking - Flaming- Threats )

  1. ------data type is used to store integers only.

( Char – Decimal - Single - Integer )

  1. When assigning a value in memory location (address) , this value is ------.

( Adding to the previous value – replacing by the previous value –subtracted from the previous value - – dividedby the previous value )

  1. Thecommand ( IF … then ) is called ------because it select or ignore one condition

( Single Selection – Multiple Selection - Double Selection– none of the previous)

  1. The value of (S) after executing this loop ( For S = 5 To 1 Step -1) is ------

( 0 – 1 - 2 – 5)

------

Third :Complete:

  1. ------is the Keyword used to declare a variable where ------is the Keyword used to declare a Constant.
  2. ------, ------is the Keyword used to add comments inside the code window and compiler will neglect it.
  3. ------is used to handle the errors during the program execution.
  4. ------is a reserved word that expresses the current Form
  5. The reserved word ------is used to create a new line.
  6. The symbol ------is used to perform the concatenation of texts.
  7. ------are used while assigning date or Time to a constant and ------are used while assigning abstract value to a variable of String data type.
  8. The symbol ------is represent the assignment operator in VB
  9. ------enables writing the long line of code in more than one line.
  10. ------is a part of the code its result True or false according to a value or variables.
  11. Declaration of sub procedures or function procedures is done on the ------level.
  12. Procedures in VB.net have two types ------value and ------that returns value.
  13. ------is a method used to set the cursor focus inside textbox control.
  14. The values 3, 5 in this code (TextBox2.Text = Sum (3, 5) ) are called ------
  15. We use ------loop statement when we don`t know the number of prepetition in advance.

------

Fourth : With the help of the code, complete the followings :

(For … Next ) Loop / (Do …. While ) Loop
Dim X , I As single
X = 4.5
For I = 0 To 7 Step 3
X = X * 2
Next

(A) This loop will be repeated for …………… times .

(B) The loop ends when ……………………………………………......

(C) The value of the variable X after the loop ……………

D)Rewrite the codes using DO …. While loop

Fifth : When this commands And keyword used:

command / usage
1 / IF…Then
2 / IF…Then… Else
3 / For…. Next
4 / Select …. case
5 / Do…While..Loop
6 / Function
7 / Sub
8 / Comparison Operators

Sixth : Consider the following code, which receives the user age entered in (TextBox1)and types and displays a quote according to the age.

Dim age As Byte

age = Me . TextBox1 . Text

Select Case age

Case 40

Label1 . Text = " Mature "

Case IS < 2

Label1 . Text = " Baby "

Case 2 To 10

Label1 . Text = " Child "

Case 12 To 19

Label1 . Text = " Teenager "

Case IS > = 20

Label1 . Text = " Adult "

Case Else

Label1 . Text = " Out Of The Game"

End Select

Write down the result displayed in (Label 1), when you enter the following values of age in Textbox1

Age / 16 / 20 / 9 / 40 / 11 / 1
Result

Seventh :Write the codes to :

  1. Display the even numbers in descending order from 1 to 20 in MsgBox using (For ..Next).
  2. Copy the contents of TextBox1 control in TextBox2 .
  3. clear the items from ListBox1.
  4. Assign the value of TextBox1.Text to the variable Degree.

1