Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
final revision sheet prep3.doc
Скачиваний:
0
Добавлен:
01.07.2025
Размер:
833.02 Кб
Скачать

Dim u_Name As String

  1. Declare two variables (W , L) as a non integers

Dim w , l As Single

Q5: Match from the first column with the suitable in the second column:

A

B

1

Integer

Is used for saving this sort of string data.

( 4 )

2

Date

Is used for saving the logical data which take “False” or “True” value

( 5 )

3

Decimal

Is used for saving data in the form of date and time.

( 2 )

4

String

Is used for saving data which contain decimals and integers.

( 3 )

5

Boolean

Is used for saving data in the form of integer and don’t have decimals.

( 1 )

A

B

1

Byte – Short – Integer - Long

Data types for storing integer and decimal

( 4 )

2

Declaring Constants

It is used in Visual Basic.Net to link text values.

( 3 )

3

(&) Sign

Data types for storing integer.

( 1 )

4

Single – Double – Decimal

Variable Name or Property = Value

( 6 )

5

Declaring Variables

Const Constant Name As Constant Type = Value

( 2 )

6

Assignment Statement

Dim A1_Mostakbal As String

( 5 )

Q6: Correct the underline:

  1. To set line as a comment not be executed when starting the program, type Dim at the start of the line in the code window.

……………………………………………………………………………..REM…………

  1. To save the student age uses the variable String.

………………………………………Byte or Single……………………………………..

  1. To save data containing decimals and keep them without approximation we use the Long data type.

………………………………………………………………………………………Single

Q7: Second: In the following code, get the variable names and constants and their Data Types.

Variable Names

Type

Radius

Single

Constant Names

Type

X

Single

Q7: Third: In the following code, determine the cause of the displayed error

"Fifteen degrees"

The cause of errors:

Because Enter (String value)

The cause of errors:

Because Enter values outside the range of the variable

Q8: Determine the type of error in the following, and then perform the required error handling.

Code

error type

error handling

Din x As Single

Syntax Error

Dim

Const x As Single

Syntax Error

Const x As Single = value

Q9: When writing code the user needs to add specific comment that will not be executed, so the code must be preceded by:

1. REM

OR

2. ( ‘ )

Q10: in the following code explain the lines of code, indicated by the numbers as shown in the figure.

1

2

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]