Visual Basic .Net True / False Dr. Ebrahimi
Delete either T or F of each question and after you have finished the quiz email to ebrahimidr@gmail.com
Make your own ten questions.
Answer all 100 questions.
Name__________________________________Spring 2006
T / F 1) A systematic way or step by step procedure to solve problem is known as an Logarithm.
T / F 2) A program is a set of hardware that tell a computer what to do.
T / F 3) Every character languages has its own ASCII code, such as 65 for uppercase A, 97 for lowercase a and 48 for zero.
T / F 4) Computer languages are ambiguous and natural languages are not ambiguous.
T / F 5) Visual Basic.net was developed before Visual Basic and Basic.
T / F 6)The arithmetic expression 3+4*9 will evaluate to the same result as (3+4)*9.
T / F 7) Every problem has only one algorithm to solve it.
T / F 8) Human intervention is required to review logical statements, because the compiler will not catch logical errors.
T / F 9) In order to get an output from a program you must edit, compile, and execute the program.
T / F 10) \ is in many languages including VB to represent division.
T / F 11) You can still execute a program even if there is a warning.
T / F 12) In Visual Basic .Net, an “ If …Then…Else” statement is used to create a loop.
T / F 13) The symbol ' is used to comment a line of text in vb.
T / F 14) Basic, Visual Basic, C, C++, Visual Basic .Net, Java, and C# are all visual programming languages.
T / F 15) The binary state of a computer is represented as 0 and 1 at the lowest level.
T / F 16) A comment will not executed by the program and compiler will ignore the translation of the comment .
T / F 17) Basic is better than Visual Basic and Visual Basic.net because it is simple object oriented.
T / F 18) Visual basic.net is an object oriented and event programming language.
T / F 19) Visual Basic was developed before Basic and Visual Basic.net.
T / F 20) Visual Basic.net are user Friendly and were designed for teaching purposes.
T / F 21) A program consists of input, output and process respectively.
T / F 22) you can program any toolbox control by a single click.
T / F 23) An original Basic was line oriented therefore to execute multiple statements you must use goto statement with a line number.
T / F 24) Basic was designed by two professors John F. Kennedy and Thomas Krutz from Dartmouth College.
T / F 25) HoursWorked=Msgbox(“Enter the Employee Id”) is logically a correct statement.
T / F 26) One way to make a decision in a program is to use an If statement.
T / F 27) To find the maximum of two numbers, the following If statement can be used:
If a < b Then
max = a
Else
max = b
End If
T / F 28) The following will set different a tax rate depending on gross pay:
If grosspay > 500 Then
taxrate = 0.20
Else
taxrate = 0.20
End If
T / F 29) Overtime pay can be computed using the following:
If hoursworked > 40 Then
overtimehours = hoursworked - 40
overtimepay= overtimehours * hourlyrate *1.5
Else
overtimehours = 0
overtimepay=0
end if
T / F 30) This validation can be used to make sure gross pay is a positive value:
If grosspay > 0 Then
MsgBox(grosspay)
Else
MsgBox(“Error in gross pay”)
End If
T / F 32) Every Else in a program must correspond to an If statement.
T / F 33) Both conditions need to be True for “Hellooooooo” to be displayed:
If grosspay>50000 Or grosspay<0 Then MsgBox(“Hellooooooo”)
T / F 34) The following statement is always True: while (0).
T / F 35) There is a logical error in the following:
If number > max Then
max = number
Else min = number
T / F 36) User interaction, comparison with stored data, and response are components of a search program.
T / F 37) The following statement is logically correct:
If hoursworked > 40 Then
overtimehours = hoursworked – 40
Else
overtimehours = 0
End if
T /F 38) The following statement can be used to verify that a number has been entered for hours worked before using it to compute gross pay:
If TextBox1.Text = “” Then
Msgbox(“ENTER A VALUE FOR HOURS WORKED”)
TextBox1.SetFocus
Else
TextBox3.Text = TextBox1.Text * TextBox2.Text
End If
T / F 39) Net pay is needed in order to calculate the tax amount.
T / F 40) CheckBox can be used when only one entry can be selected, for example, marital status (married, single) or credit card(Visa, Master card).
T / F 41) When you have to choose two or more options among many, you have to use RadioButtons. For examples, health insurance likes full coverage, dental etc.
T / F 42) The following statements will assign an employee with a gross pay of 0 a tax rate of 10%:
If grosspay > 500 Then
taxrate = 0.20
ElseIf grosspay > 300 Then
taxrate = 0.15
Else
taxrate = 0.10
End If
T / F 43) The keyword And represents a logical operator that can be used in a condition for an If statement.
T / F 44) The keyword Or represents a logical operator that when used in a condition, the condition will be True only when both expressions are True.
T / F 45) In a sequential file system, often a large portion of the file must be read in order to find one specific item.
T / F 46) While counter is the same as While counter != 0.
T / F 47) In order to work with a file in your program you must open and indicate what you want to do with the file.
T / F 48) To sum a series of numbers you need to initialize the sum = 1.
T / F 49) The following loop will read all employeeid from a file one by one.
While myfile.Peek <> -1
employeeid = myfile.ReadLine
End While
T / F 50) The following loop will compute the gross pay for 20 employees:
For i = 0 To 20
grosspay= InputBox(“Enter hours worked: “)
Next
T / F 51) The values 5 and 6 will be displayed:
Dim x As Integer
x = 5
x = 6
MsgBox(x)
MsgBox(x)
T / F 52) In Visual Basic, the expression 2 < 3 always evaluates to true, and 0 is always false.
T / F 53) The statement While 1 … End While in a program will loop forever.
T / F 54) Reserved words While, For, and Do While can be used to loop.
T / F 55) The Not operator means negation.
T / F 56) The assignment statement c = c + 1 is same as c += 1.
T / F 57) To loop five times we need: Dim counter As Integer While counter >5 counter = counter + 1 End While.
T / F 58) When using end of file it is necessary to stop the loop by a counter variable in a loop condition.
T / F 59) To loop a program 5 times, you must write the program 5 times.
T / F 60) To run a program with a large amount of data it is better to enter the data each time interactively.
T / F 61) Every time you recompile a program you must also recompile its data file.
T / F 62) If there are no errors detected by the compiler, the program output is correct.
T / F 63) The declaration:
Dim employeeid as integer is incorrect.
T / F 64) A dummy value that is used to stop a loop is known as a sentinel.
T / F 68) The position of braces in a loop is very important and you can’t choose your own style.
T / F 69) BASIC means Beginners‘ All-purpose Symbolic Instruction Code.
T / F 70) Visual Basic is a high level programming language evolved from the earlier DOS version called BASIC.
T / F 71) By visualization, it means that Visual Basic will display the execution of program visually.
T / F 72) The following statement adds the two values in the textboxes:
TextBox3.Text = TextBox2.Text + TextBox1.Text
T / F 73) The following is a valid Visual Basic statement:
Dim tax rate As Single
Tax rate = TextBox1.Text
T / F 74) If you don’t change the name for the controls all the name are defaulted with a number for example Text1 instead of hours worked.
T / F 75) When you start the VB environment, you are in the design mode rather than run mode.
T / F 76) You can change the name of a control in the Text property.
T / F 77) It is a Visual Basic convention to name a control with a shorthand prefix such as txthoursworked, 1b1hoursworked, btncomputenetpay.
T / F 78) The following statement is logically correct:
If hour>40 Then
Overtimehour = hour – 40
Else
Overtimehour = 10
End if
T / F 79) The following statement doesn’t compute grosspay when there is a blank in the textbox:
If textbox1.text = “” then
Msgbox(“ENTER A VALUE”)
Textbox1.setfocus
If text
Else
Textbox3.text = textbox1.text*textbox2.text
T / F 80) Every control can be programmed. For example a TextBox can be programmed.
T / F 81) TextBox1.TextChanged will activate when you click the command button.
T / F 82) By using buttons or textboxes with the labels you can design interfaces such as telephone or calculators.
T / F 83) You can’t use code to change properties of any controls, for example
Textbox .text .visible = true, or text1.forecolor = color.green
T / F 84) Visual basic is not a event-driven programming language, it is a procedural language. For example, botton1_ click() or botton2_doubleclick()
T / F 85) Text box can use for input as well as output.
T / F 86) To perform arithmetic operation in visual basic, * is used for multiplication and ÷ is used for division.
T / F 87) In order to calculate overtime we need to know hourly rate in the textbox2
T / F 88) The grosspay variable will be declared as integer or string.
T / F 89) Declaring a variable
or constant is an optional in visual Basic
T / F 90) when you have to choose two or more options among many, you have to use radio buttons. For examples, health insurance likes full coverage, dental etc.
T / F 91) radio buttons must be grouped in a frame
T / F 92) the following are nested if statement:
If grosspay>500 then taxrate=0.20
If grosspay >300 then taxrate=0.15
if grosspay<=300 then taxrate=.10
T / F 93) the following if statement has the same taxrate as above
If grosspay>500 then
Taxrate=0.20
Elseif grosspay>300 then
taxrate=0.15
else
taxrate=0.10
end if
T / F 94) the following statement will clear and end the program
textbox1.text=”“
End
End sub
T / F 95) dim is stand for dimension and it is used declare variables of integer, single, double, string. For example
T / F 96) the following statement indicates the variable netpay is a whole number instead of fraction
Dimension netpay as single
T / F 97) the following one is valid:
If textbox1.text=”ebrahimi” then
Msgbox(“your salary is” , netpay)
end if
T / F 98) The input part is where the information is entered by the user and stored in a memory location.
T / F 99) In Visual Basic it is not necessary to declare the variable.
T / F 100) The difference between a single and a double is the way you request a memory for the value from the compiler