Midterm review Flashcards
1
Q
Using Directive
A
- Using System
- tells the compiler where to look for a class that’s used in this app
- Each using directive identifies a namespace containing predefined classes that a C# app should be able to use
2
Q
White space
A
- space bar, tab, blank lines
- Ignored by the compiler
- make code easier to read
3
Q
Class Name Convention
A
- begin with a capital letter and capitalize the first letter of each word they include
- a series of characters consisting of letters, digits and underscores (_) that does not begin with a digit and does not contain spaces
4
Q
Write
A
- cursor stays on the same line of text in the console window
5
Q
WriteLine
A
- cursor moves to the next line of text in the console window
6
Q
escape sequence
A
- \n, \t, \r, ", \
7
Q
\n
A
- New line. Positions the screen cursor at the beginning of the next line
8
Q
\t
A
- Horizontal tab. Moves the screen cursor to the next tab stop
9
Q
\r
A
- Carriage return. Positions the screen cursor at the beginning of the current line—does not advance the cursor to the next line. Any characters output after the carriage return overwrite the characters previously output on that line.
10
Q
"
A
- Double quote. Used to place a double-quote character (“) in a string—e,g., Console.Write( “"in quotes"” ); displays “in quotes”.
11
Q
\
A
Backslash. Used to place a backslash character in a string.
12
Q
declare a class named “Addition”
A
public class Addition
13
Q
declare the main method
A
public static void Main(string [ ] args)
{
}
14
Q
declare “number1” as an integer data type
A
int number1;
15
Q
initialize number1 as an integer data type equal to 10
A
int number1 = 10;
16
Q
convert “number1” to an Integer data type
A
number1 = Convert.ToInt32( Console.ReadLine ( ) );
17
Q
Integer data types
A
- byte
- short
- int
- long
18
Q
floating point data types
A
- float
- double
- decimal
19
Q
char data type
A
- one character - “A”
20
Q
Bool data type
A
- true / false
- yes / no
21
Q
String data type
A
“my name is Krista”
22
Q
Simple data types
A
- int
- float
- char
- bool
23
Q
complex data type
A
string
24
Q
=
A
- assignment oppertator
- reads right side first