General C# Flashcards

1
Q

How would you convert the string input to a int.

string score = “32”;

A

int score1 = Convert.ToInt32(score);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does const in the following example mean.

const int max = 4;

A

that the variable can not be modified

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What would you wrap around the letter A in the example to store a char into a variable?

char firstletter = A;

A

char firstletter = ‘A’;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the different Jumping statements?

A
break
continue
goto
return
throw
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How would you change this string into a float?

string answer = “23”;

A

float answer2 = float.Parse(answer);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly