Find any errors in the following BankAccout contructor:
Public int BankAccount ( )
{
Balance = 0;
}
A -
No errors
B -
Name
C -
Return type
D -
Format parameters
2-
For decimal, the default calue is ____.
A -
0.0m
B -
0.0d
C -
0
D -
Nonr of the above
3-
for(int i = 0; i<2; i++)
for(int j = 0; j<3; j++
if (i= =j) continue;
Console.WriteLine ("i={0} j={1}, i, j);
Which lines would be the part of output?
A -
i=2 j=3
B -
i=0 j=0
C -
i=1 j=0
D -
i=0 j=1
4-
Give the method header for each of the following methods:
Method Smallest, which takes three integers x, y and z returns an integer.
A -
void Smallest(int x, int y, int z)
B -
int Smallest(x, y, z)
C -
int Smallest(int x, int y, int z)
D -
Smallest(int x, int y, int z)
5-
Given the data assigned to the string variable y shown below, which of the following
statements will assign the value ALL to the string variable x?
y = "WHEN ALL ELSE FALLS, READ THE DIRECTIONS"
A -
x = y.Substring(6, 3)
B -
x = y.Substring(5)
C -
x = y.IndexOf("ALL")
D -
x = y.Substring(5, 3)
6-
Giving the following example
Static void DoWork(out int param)
{
// Do nothing
}
A -
the example does not compile because C# have no out keyword
B -
the example compile OK
C -
the example does not compile DoWork do nothing
D -
the example does not compile because DoWork does not assign a value to param
7-
Here is an example of one class:
Class Example
{
void firstMethod( )
{
myField = 42;
. . .
}
void anotherMethod( )
{
myField++;
. . .
}
Int myField = 0;
}
A -
This class is OK. But we have 3 difference variable name myField in contexts
B -
This class is Failed. You must declare myField variable with public keyword
C -
This class is Failed. You must declsre a variable before tou can use it
D -
This class is OK. The variable myField is defined in the class but outside the methods firsMethod and anotherMethod. Therefore, myField has class scope and is available for use by all methods in the class
8-
How many main( ) function can be in a #
A -
2
B -
only 1
C -
more than 1
D -
3
9-
How do you disable the default context menu of a textbox using code?
A -
textBox1.ContextMenu = new ContextMenu();
B -
textBox1.ContextMenu = NULL;
C -
textBox1.ContextMenu = Nothing;
D -
textBox1.ContextMenu = false;
10-
How to get the alphabet in uppercase A (ASCII = 65) through Z (ASCII = 90)?
A -
protected void GetAlphabet(){ string strAlpha = ""; for (int i = 65; i<=90;i++) { strAlpha += ((char)i).Tostring() + ""; }}
B -
protected void GetAlphabet(){ string strAlpha = ""; for (int i = 65; i<=90;i++) { strAlpha += char(i.Tostring()) + ""; }}
C -
protected void GetAlphabet(){ string strAlpha = ""; for (int i = 65; i<=90;i++) { strAlpha += i.Tostring() + ""; }}
D -
protected void GetAlphabet(){ string strAlpha = ""; for (int i = 65; i<=90;i++) { strAlpha += i.ToChar() + ""; }}