C# Basics (Teamtreehouse) Flashcards

1
Q

What is a return type?

A

The type of information a method returns.

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

What are the four P’s of Problem Solving?

A

Four P’s of Problem Solving

Prepare - This is where we understand and diagnose the problem.

Plan - This is where we organize everything before acting.

Perform - We simply put the plan into action.

Perfect - This is when we check to see if what we made has solved the problem and consider how to make it better. We can use the Four P’s again to make improvements.

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

What signifies the end of statement of code?

A

Semicolon signifies the end of statement of code.

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

What is a compiler?

A

A compiler is a program that converts human readable code into machine readable code to be executed by a computer.

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

What is camel casing?

A

A convention in which the first letter is lowercase and each subsequent concatenated word is capitalized.

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

What is pascal casing?

A

A convention in which the first letter is uppercase and each subsequent concatenated word is capitalized.

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

What is the name of the namespace in the following method call: Adobe.Illustrator.Canvas.Paint();?

A

Adobe.Illustrator

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

What is the name of the class in the following method call: StackOverflow.Controllers.CommentController.Details();?

A

CommentController

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

What is the name of the method in the following method call: Apple.IPhone.Dialer.Dial(string phoneNumber);?

A

Dial

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

What does void return type represent in method signature?

A

Void return type specifies that the method doesn’t return a value.

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

What are character escape sequence in C#?

A

C# defines the following character escape sequences:

' – single quote, needed for character literals
" – double quote, needed for string literals
\ – backslash
\0 – Unicode character 0
\a – Alert (character 7)
\b – Backspace (character 8)
\f – Form feed (character 12)
\n – New line (character 10)
\r – Carriage return (character 13)
\t – Horizontal tab (character 9)
\v – Vertical quote (character 11)
\uxxxx – Unicode escape sequence for character with hex value xxxx
\xn[n][n][n] – Unicode escape sequence for character with hex value nnnn (variable length version of \uxxxx)
\Uxxxxxxxx – Unicode escape sequence for character with hex value xxxxxxxx (for generating surrogates)

Of these, \a, \f, \v, \x and \U are rarely used in my experience.

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

How do you read a call stack trace?

A

From the bottom up.

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

List possible combinations in mixing integers and doubles in arithmetic operations and their resulting type.

A

Mixing integers and doubles in arithmetic operations:

int double double
int int int (beware of truncation!)
double int double

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

What is casting? Provide example.

A

Casting is explicit conversion from one data type to another. Double > Int, BaseClass > Derived Class. For example: int x = (int)(5 / 2.5);

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

What is code refactoring?

A

When you change the code of program without changing apparent functionality.

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