1.
Consider the following code:
Dim n as Integer = -8
n = 100 / n + 4
What is the value of n after the code is run?
Correct Answer
A. -8.5
Explanation
The value of n after the code is run is -8.5. In the code, n is initially set to -8. Then, the expression 100 / n + 4 is evaluated. Since n is -8, the division operation results in -12.5. Adding 4 to -12.5 gives us -8.5, which is the final value of n.
2.
Consider the following code:
Dim n as Integer = -8
n = 100 / (n + 4)
What is the value of n after the code is run?
Correct Answer
E. -25
Explanation
The code assigns the value of -8 to the variable n. Then, it calculates the expression 100 / (-8 + 4), which simplifies to 100 / -4, resulting in -25. Therefore, the value of n after the code is run is -25.
3.
Which of the following expressions might be used in a calculation to determine leap year?
Correct Answer
D. Year Mod 4
Explanation
The expression "year Mod 4" can be used to determine if a year is a leap year or not. In this expression, "Mod" represents the modulus operator, which calculates the remainder when the year is divided by 4. If the remainder is 0, then the year is divisible by 4 and is a leap year. If the remainder is not 0, then the year is not divisible by 4 and is not a leap year.
4.
What will be the value of z as a result of the following statement?
Dim z as Integer
z = 50 \ 15
Correct Answer
A. 3
Explanation
The value of z will be 3 as a result of the following statement. The expression "50 \ 15" performs integer division, which means that it divides 50 by 15 and returns the quotient without any decimal places. In this case, the quotient is 3. Therefore, the value of z will be 3.
5.
Assuming the variables x1, x2, y1, and y2 have been declared as integers, have been assigned values, and represent the coordinates of two points on the coordinate grid, write the statement to calculate the slope.
Extra credit: Find the y intercept (e.g., the 'b' in y = mx + b)
6.
Declare four variables (String, boolean, integer, and double) that you would need if you were to write Power School
7.
A label control is used to perform an action when clicked
Correct Answer
B. False
Explanation
A label control is not used to perform an action when clicked. It is typically used to display text or provide information to the user. Instead, a button control is commonly used to perform an action when clicked. Therefore, the correct answer is false.
8.
The most important information on a form should be in the upper-left corner of the form.
Correct Answer
A. True
Explanation
The upper-left corner of a form is considered the prime real estate because it is the first area that the eye is naturally drawn to when reading a document. Placing important information in this location ensures that it will be easily noticed and not overlooked. By placing crucial details in the upper-left corner, it increases the chances of users quickly and efficiently processing the information on the form. This layout principle is based on the natural reading pattern of most cultures, where the eye starts from the top left and moves to the right and down.
9.
The use of multiple fonts and multiple font sizes is a good idea.
Correct Answer
B. False
Explanation
Using multiple fonts and font sizes can create a visually cluttered and unprofessional appearance. Consistency in font usage helps maintain a cohesive and organized design. It is generally recommended to stick to one or two fonts and use font sizes consistently throughout a document or design to ensure readability and visual harmony.
10.
The arithmetic operators *, /, + and - all have the same level of precedence.
Correct Answer
B. False
Explanation
The arithmetic operators *, /, +, and - do not have the same level of precedence. In mathematics, multiplication and division have a higher precedence than addition and subtraction. This means that when an expression contains both multiplication/division and addition/subtraction, the multiplication/division operations will be performed first. Therefore, the correct answer is False.
11.
You specify a default button by setting the form’s AcceptButton property to the name of the button.
Correct Answer
A. True
Explanation
To specify a default button in a form, the AcceptButton property needs to be set to the name of the button. This means that when the user presses the Enter key, the button specified as the default will be triggered. Therefore, the given statement is true.
12.
Whish property controls the caption displayed on the Forms title bar?
Correct Answer
A. Text
Explanation
The property that controls the caption displayed on the Form's title bar is "Text". This property allows the developer to set the text that appears in the title bar of the Form. By assigning a value to the "Text" property, the developer can customize the caption to display any desired text.
13.
The tool that displays text which the user is not allowed to edit while the application is running is _____.
Correct Answer
A. Label
Explanation
A label is a tool that displays text which the user is not allowed to edit while the application is running. It is typically used to provide information or instructions to the user. Unlike a text box, radio button, or button, a label is a static element that cannot be modified by the user.
14.
TOE stands for
Correct Answer
C. Task, Object, Event
Explanation
The correct answer is "Task, Object, Event". In the context of computer programming, TOE is an acronym that represents the three fundamental components of an object-oriented system. A task refers to a specific action or behavior that an object can perform. An object is an instance of a class and represents a specific entity or concept in the system. An event is a trigger or notification that occurs within the system. Therefore, "Task, Object, Event" accurately describes the key elements of an object-oriented system.
15.
A variable that can only be true or false is what kind?
Correct Answer
Boolean
boolean
Explanation
A variable that can only be true or false is called a boolean. In programming, boolean is a data type that represents true or false values. It is often used in conditional statements and logical operations to make decisions in a program. The term "boolean" is typically spelled with a lowercase "b" in programming languages like Java, while "Boolean" with an uppercase "B" is used in some other languages.
16.
The name of a Visual Basic .NET variable must begin with a(n) _______.
Correct Answer
A. Letter
Explanation
A Visual Basic .NET variable must begin with a letter. This is because variable names in Visual Basic .NET must follow certain naming conventions, and one of those conventions is that the name must start with a letter. Starting a variable name with a letter helps to differentiate it from other elements in the code and makes the code more readable and understandable.
17.
The equals sign (=) is called the ________________ operator
Correct Answer
B. Assignment
Explanation
The equals sign (=) is called the assignment operator because it is used to assign a value to a variable. In programming, the assignment operator is used to store a specific value in a variable, making it the most appropriate term to describe the equals sign.
18.
Memory locations where programs store data are called:
Correct Answer
variables
Variables
variable
Variable
Explanation
Memory locations where programs store data are called variables. In programming, variables are used to store and manipulate different types of data, such as numbers, strings, or objects. They act as containers that hold values that can be accessed and modified throughout the program. The use of variables allows for dynamic and flexible programming, as the stored data can be changed as needed during the execution of the program. Therefore, the correct answer is variables.
19.
Red/green color blindness is common. When considering using those colors you should keep what in mind?
Correct Answer
D. All of the above
Explanation
When considering using red and green colors, it is important to keep in mind that red and green have specific meanings. Additionally, shape, position, or texture should also be used to convey information effectively. Moreover, using contrasting colors can often highlight each other and improve visibility. Therefore, all of the above factors should be considered when using red and green colors.
20.
If I have a button that adds tax to a product price, what would be the most appropriate caption?
Correct Answer
A. Add Tax
Explanation
The most appropriate caption would be "Add Tax" because it is clear and concise. It effectively communicates the action of adding tax to a product price. The use of capital letters is not necessary as it does not add any additional clarity to the caption.
21.
Consider the following code
sum = sum + Convert.toString(TextBox.Text)
The variable sum is called a
Correct Answer
C. Accumulator
Explanation
The variable "sum" in the given code is being used to accumulate or accumulate the value of the converted text from the TextBox. It is not being used as a counter, property, or parameter. Therefore, the correct term to describe the variable "sum" in this context is an accumulator.
22.
If I want to combing the contents of two text boxes into one label, which statememt would I use?
Correct Answer
B. Label1.text = TextBox1.Text + TextBox2.text
Explanation
To combine the contents of two text boxes into one label, the correct statement to use is "Label1.text = TextBox1.Text + TextBox2.text". This statement assigns the concatenated value of the text in TextBox1 and TextBox2 to the text property of Label1, resulting in the combined contents being displayed in the label.
23.
Complete the following code by computing the total cost of purchasing show tickets that includes the service charge per ticket and tax
Dim n as Innteger = Convert,toString(txtNumberofTickets.Text)
Dim c as Double = Convert.toDouble(txtCostperTickket.Text)
Dim service as Double = 2.75 ' Added on to each ticket
Dim salesTax as Double = 0.075
lblTotalCost.text = ' Write the appripopriate expressionin the answer block