part 1 Flashcards

1
Q

What is .Net?
Name three main components.

A

.Net is the entire ecosystem surrounding C# programs. It includes a runtime, the base class library, and an SDK

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

What is a runtime?

A

IT is the environment your C# program runs within.

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

what is the base class library(BCL)?

A

a set of fundamental C# building blocks

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

What 3 other popular languages utilize .Net?

A

Visual Basic, F#, and Powershell

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

What is an IDE and what is it used for?

A

Integrated Development Environment. A program that combines tools into an application designed to streamline the programming process.

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

Name the two main components to a C# program, each pieces main purpose, and the file extension.

A

source code (.cs) - instructions written in C# for the computer to run.

configuration (.csproj) - instructions for the computer to help it compile the C# code into binary instructions.

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

What does the compiler do and what file types can be the result from it?

A

It takes the C# code and projects configuration (.cs and .csproj) and produces the final binary instructions for the computer to run directly.

The result is either a .exe or .dll file

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

What is a literal?

A

a chunk of code that defines some specific value, precisely as written.

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

What is an identifier?

A

It refers to some existing code element.

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

What is the period character below and what does it do?
Console.WriteLine()

A

The member access operator
or
the dot operator

It allows us to move down in the hierarchy to access children (also called members) of a container.

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

What is the process of ‘name binding’?

A

The compiler working to identify what code element an identifier refers to.

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

Can a class have methods as members?

A

Yes, but a method cannot have a class as a member.

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

What are the two main components of a class?

A

The data they need to do their job
and
tasks they can perform

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

What is a method?

A

A named, reusable block of code that you can request to run.

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

What is ‘method invocation’ or a ‘method call’ and how is it performed?

A

The act of asking a method to run.
by using a set of parentheses after the method name

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

Do all methods require data to perform their task?

A

No.

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

Can some methods return data?

A

Yes.

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

What is the container that most classes live in called?

A

A namespace

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

What is the ‘main method’ or ‘entry point’ and what class does it live in?

A

The code that will automatically run when the computer runs your program. Other methods won’t run unless the main method calls them.
The Program Class

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

What is a statement and how do you typically end it?

A

A single step or command for the computer to run.
Most C# statements end with a semicolon.

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

In what order are statements run?

A

Top to bottom, left to right

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

How does C# handle whitespaces including tabs, spaces, and new lines?

A

It ignores them as long as it can tell where one thing ends and another begins.

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

What is an expression?
What is the output?
What can be done with that output?

A

Bits of code that your program must process or evaluate to determine their value.
They describe how to produce a value from smaller elements. This value can be used in other expressions or other parts of your code.

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

What is a variable and what are it’s three parts?

A

Containers for data whose contents can change or vary as the program runs. They allow us to store data for later use.

Name, value, and type

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

How do you declare a variable?

A

Provide a name and type

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

How do you assign a variable?

A

Once a variable exists, we can place data in the variable, or assign it a value. This is done by placing a variable name on the left side of an equal sign and the new value on the right side

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

What is a keyword and can a variable share it’s name?

A

A word with special meaning in programming, a variable cannot share the same name as a keyword.

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

What is a complier error vs a compiler warning?

A

A compiler error is the result of bad code that prevented the compiler from fully completing.
A warning is intended to highlight potential issues with code.

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

What is debugging?

A

the process of figuring out why a program does not do what you expected and then adjusting it.

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

What is ‘configuration data’ and what are the two default configurations and what is the main difference between the two?

A

It provides data to the compiler about how to build things.
Debug and release.
Release has optimization turned on which allows the compiler to make adjustments so the code can run faster. It’s better to build and troubleshoot in Debug and then share the finished product in release.

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

What are the two ways to add a comment and how are they functionally different?

A

// starts a single line comment
/* and */ can encompass multiple lines

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

Does using a variable in an expression change the value of the variable?

A

No it is just a copy.

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

What type of memory is used for storing variables? Does it remain after the program closes?

A

volatile memory or RAM.
No, it is wiped out after the program closes or the computer is rebooted.

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

Why are variables typically declared early on in the code?

A

Because a variable has to be declared before it can be used

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

How many times can you declare a variable?

A

Only once

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

Is assigning value the same thing as declaring?

A

No, declaring makes the name and type, assigning gives it a value.
Declaring can be done once, while a variable can have new values assigned to it

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

What is a type?

A

It represents a kind of data it’s rules for representing values in binary

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

What is an int type?

A

Integer - this represents a whole number that can be positive negative or 0

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

How do you type the value for a string?

A

By surrounding it with double quotes

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

Can you declare a variable and initialize it on the same line?

A

yes

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

Can you declare multiple variables simultaneously? If so, what datapoint do they have to have in common to do so?

A

Yes, they have to be the same type

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

Can you assign the same value to multiple variables at once?

A

Yes, variable assignments are also expressions that evaluate to whatever the assigned value was

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

Can Console.WriteLine work with any type?

A

Yes

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

What characters can variables start with?
Can they contain numeric values?

A

a letter or underscore
yes as long as they don’t start with one

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

What characters cannot be used in variable names and why?

A

most symbols and whitespace characters
to avoid confusion about where it starts and ends

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

Name three useful rules for naming variables

A

Accurately describe what the variable holds
Don’t abbreviate or remove letters
Don’t end in numbers
Avoid generic catch-all names
make the boundaries between multi-word names clear

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

What are the two casing conventions among C# programmers for naming items, what are their differences, and how are they typically used?

A

camelCase (lowerCamelCase) first word is lowercase and each subsequent word starts with a capital letter
PascalCase (UpperCamelCase) all words start with a capital letter

camelCase for variables and PascalCase for other items

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

How can you tell the compiler to figure out a datatype when initializing a variable?
What is this feature called?
Do you have to declare and initialize the variable on the same line for this to work?

A

by using var
type inference
yes, otherwise there is not enough data

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

Name two reasons that type inference is not recommended for new coders.

A

The computer could infer the wrong type and these errors can be subtle
as you’re learning, you may not be able to infer as accurately as the computer does and it could cause confusion when writing or reviewing code

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

Does a variable using var have a specific type?

A

yes, they always have a single type and it’s not changeable or a catch-all

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

What language do computers process data in?

A

Binary

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

Can we convert from one type to another?

A

Yes, it’s often necessary

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

What is the smallest bit of data that the computer will deal with and what is the size of data in C# for every character?

A

bytes
two bytes

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

Why are there so many different integer types? What is the difference between signed and unsigned?

A

They each use a different number of bytes which allows you to use more or less memory to store larger or smaller numbers as needed.
signed numbers include negatives, unsigned don’t so they are able to represent twice as many positive numbers in their range compared to their counterparts

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

Which integer types are signed?

A

short, int and long

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

list the bytes used for int type

A

4 bytes

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

list the bytes used and number range for short type

A

2 bytes
roughly -32k and 32k

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

list the bytes used and number range for long type

A

8 bytes
roughly -9 quintillion and 9 quintillion

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

what are the ranges for unsigned int, short, and long types?

A

short - 0 to approx 65k
int - 0 to approx 4 billion
long - 0 to approx 18 quintillion

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

what is the byte type and when is it typically used?

A

uses a single byte to represent values from 0 to 255 (unsigned), most often used to express a byte or collection of bytes with no specific structure or none known to the program.

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

does the byte type have a signed counterpart?

A

Yes, it represents a range of -128 to 127 and is used very rarely

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

What happens if you try to store a value that is higher than the range of the type assigned to it?

A

You would get a compiler error unless it is within range of the unsigned counterpart of your type

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

How can you force a smaller number to be a larger literal type?

A

by adding U or L or both at the end of the number
U - signifies unsigned
L - signifies a long

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

What can be used as a digit separator (similar to commas i.e. 1,000,000) in C# and what are the rules?

A

an underscore and this can be spaced in anyway

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

Which four integer types are most commonly used over the others?

A

int, uint, long or ulong

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

how do you write a binary literal?

A

by starting the number with 0b

67
Q

how do you write a hexadecimal literal?

A

by starting your number with 0x

68
Q

what character ranges are used for hexadecimal digits?

A

0 through 9 and A through F

69
Q

What is a char type and how does it differ from a string?

A

the char type represents a single character while a string represents text of any length

70
Q

list the bytes used and characters used for char type

A

two bytes
65,536 distinct characters

71
Q

How do you write out a char type’s value?

A

by placing it in single quotes

72
Q

What group of types is char most closely associated to?

A

integer. Each character of interest is given a number that represents it which results in a unique bit pattern

73
Q

What widely used standard for assigning numbers to characters is used for the char type and what languages characters does this include?

A

Unicode - all characters in human readable language

74
Q

How can you type a hexadecimal unicode symbol for a character in your char type variable?

A

by starting the data with \u

75
Q

What are floating point types? Name the three different ones.

A

these represent real numbers including fractions and decimals
float, double and decimal

76
Q

list the bytes used, number range, and digits of precision for float type

A

4 bytes
1.0x10 to the -45th to 3.4x10 to the 38th
7 digits

77
Q

list the bytes used for double type

78
Q

list the bytes for decimal type

79
Q

how do you write a float literal?

A

adding f or F to the end of a number (with or without the decimal point)

80
Q

how do you write a decimal literal?

A

adding m or M to the end of a number (m is for money)

81
Q

What type will a number literal that contains a decimal point default to?

A

A double literal

82
Q

Which group of types can represent a larger range than the other:
floating point or integer?

A

all floating point types can represent a larger range than any integer type

83
Q

How can an exponent (to the nth power) be represented in floating point numbers in your code?

A

by adding e or E in the number

84
Q

What is the bool type and how much memory does it use?

A

It is a true false type representing boolean logic
(C# does not equate bool with ints where false would equate to 0, this is to prevent common bugs)
it uses a byte

85
Q

What can the Convert class be used for?

A

For converting data between the different built-in types.

86
Q

When using the Convert class, what other pieces of data are needed?

A

The specific ToWhatever method (one exists for each built-in type) and the value to be converted
string myNumber = “34”
Convert.ToInt32(myNumber);

87
Q

What type will the input from a console window always be?

88
Q

What is parsing in the context of C#?
What class can do this?

A

The process of analyzing text, breaking it apart, and transforming it into other data.
The Convert class

89
Q

Order the following by how large their range is:
short, long, int, byte

A

byte, short, int, long

90
Q

What is the main aim of Object Oriented Programming?

A

to bind together data and the functions that operate on them so that no other part od the code can access this data except that function

91
Q

What is a class?

A

A user-defined datatype. Like a blueprint for an object

92
Q

What is an Object?

A

A base unit of OOP that is contained and whose contents are only accessible to itself. for example, when a class is defined, no memory is allocated, but when it is instantiated memory is allocated.

93
Q

What three elements does an object have?

A

an identity, state, and behavior

94
Q

What are the four pillars of OOP?

A

encapsulation
abstraction
inheritance
polymorphism

95
Q

What is data abstraction?

A

Providing only essential info about the data to the outside world, hiding the background details or implementation.

96
Q

what is encapsulation or data-hiding?

A

the mechanism that binds the code and the data it manipulates, the variables or data of a class are hidden from any other class

97
Q

what is inheritence?

A

the ability of a class to derive properties and characteristics from another (parent) class

98
Q

Name three benefits of OOP

A

code reusability
data hiding for better security
generic code that can work with a range of data

99
Q

What is polymorphism?

A

Meaning many forms, it allows us to avoid using lengthy switch and case statements to implement methods that can behave differently depending on the object referenced

100
Q

What is an escape and what character is used for this?

A

It tells the programming to treat the following character as a normal character instead of as part of the code
a forward slash \

101
Q

What function does \ perform and what does // do?

A

\ escapes the backslash character
//add a single line comment

102
Q

what is the difference between string concatenation and string interpolation?

A

concatenation uses the + symbol to link strings and expressions together
interpolation allows expressions to be imbedded in the string by surrounding it in curly braces and adding a $ before the quotes that start the string

103
Q

what does an @ symbol added before the quotes of a string do?

A

it creates a verbatim string literal that instructs the compiler to treat everything exactly as it looks

104
Q

What is alignment? Where does it add blank space if needed? How can the blank space be moved?

A

it lets you display a string with a specific preferred width
before the value to reach the desired width
you can display blank space after with a negative number

105
Q

What are the two limitations with preferred width?

A

you can’t easily center text
if your text is longer than the width it won’t truncate it

106
Q

how do you format data from an expression?
how do you tell it to not show non-significant 0s?

A

add a colon after the expression and then a format string
any 0 in the format indicates a digit that should show, you can instead use # to avoid non-significant 0s

107
Q

How do you format data from an expression as a percentage?

A

add a colon after the expression and then a % symbol

108
Q

if you are using preferred width and formatting, which comes first in the code?

A

preferred width

109
Q

what shortcut formatting would display a percentage with one decimal place? what about two?

A

P1 = 0.0%
P= 0.00%

110
Q

what shortcut formatting can be used to display a number with a preceding 0 and two decimal places? what about five decimal places?

A

F = 0.00
F5 = 0.00000

111
Q

In what situation will the statement immediately following the ‘if’ run?

A

Only if the condition indicated by the ‘if’ statement is true

112
Q

what three pieces make up an if statement?

A

the keyword if
followed by a set of parentheses
containing a bool expression (the if statement’s condition)

113
Q

what is the equality operator and what does it do?

A

==
sometimes called the double equals operator
it determines if the things on either side are equal, evaluating to true if they are and false if they are not

114
Q

what is a block statement and how is it made?

A

it allows you to lump many statements together and then use them anywhere that a single statement is valid
by enclosing the statements in curly braces

115
Q

Can an if statement be applied to a block statement just like a single statement?

A

yes but if the curly brackets are not used, only the first statement following the if statement is impacted by it

116
Q

Can variables used within a block be used outside of the block?

A

no, that’s outside of it’s block scope

117
Q

Can two blocks reuse the same name for different variables?

A

yes, because of scope but it should be avoided as it’s confusing

118
Q

What is an else statement?

A

it allows you to specify an alternative statement to run if the ‘if’ statement’s condition is false

119
Q

can you also wrap an else statement around a block?

120
Q

What allows you to add one or more conditions to check after the if condition and before the final else?
which pathway will be chosen when this is used?

A

an if else statement
the first one from top to bottom whose condition is true, or if none are true then the statement under the final else (if it is included)

121
Q

How do you type an inequality operator and how does it function?

A

!=
it evaluates to true if the two things are not equal and false if they are not

122
Q

How do you type the four operators related to less-than and greater-than?

A

< less than
> greater than
<= less than or equal to
>= greater than or equal to

123
Q

How do you type these three operators and what do they do?
not
and
or

A

!varName takes a single input and produces the boolean opposite
&& allows combining two bool expressions that both have to evaluate to true
|| allows combining two bool expressions where at least one has to evaluate to true

124
Q

What is nesting an if statement?

A

putting an if statement inside of another if statement

125
Q

What is the conditional operator and what are it’s components?

A

three expressions: a condition to check, an expression to evaluate if the condition is true, and one to evaluate if it is false

condition expression ? expression if true : expression if false

126
Q

What is another name for the conditional operator?
Why is it the only one called this?

A

the ternary operator. Because it takes three inputs.
It is the only operator in c# that takes three inputs

127
Q

What is a switch?
What are their pathways called?
What are the two types of switches?

A

like an if statement, they are used in situations where you want to go down one of many possible paths based on a single values properties
arms
a switch statement and a switch expression

128
Q

What are the components of the switch statement?

A

the switch keyword, a set of parentheses containing the value that decisions are based on, curly braces surround the switch block, each arm starts with case followed the value to check against, this is followed by any statement(s) that should run if this arm’s condition matches, each arm must end with a break statement

129
Q

What is the catch-all arm in a switch statement?
Is it required?

A

the default keyword
it is optional and typically added at the end of the list of arms

130
Q

What is the process of selecting which arm to run and what to do after in a switch statement?

A

top to bottom, the first arm that evaluates to true (or default if none) is run and then it jumps past the end of the switch

131
Q

Can you create multiple case statements for any arm in a switch statement?

A

yes
case 1:
case 2:
Console.WriteLine(“Runs if 1 or 2”);
break;

132
Q

What are the components of a switch expression?

A

the switches target comes before the switch keyword
case labels are replaced by the value to check for and an arrow operator => to separate the condition from the expression
breaks are gone as each arm can only have one expression
each arm is separated by a comma

133
Q

what is the wildcard option for a switch expression?
is it required?

A

an underscore
yes, the expression needs to evaluate to something or the program will crash

134
Q

What is a while loop?

A

It will repeat code over and over as long as the given condition evaluates to true
(any bool expression can be used)

135
Q

Will a while loop run if it’s condition is false initially?
When is the condition checked?

A

no
at the start of each cycle

136
Q

what is a do/while loop?
When is the condition checked?

A

this loop will always run at least once
it evaluates at the end of the loop

137
Q

what is a for loop and how is it structured?
when is the condition checked?

A

the initializing statement, condition to evaluate and updating action are added in one line (separated by semicolons) between parentheses after the for keyword
at the start, if it is initially false it will not run

138
Q

Are the three statements of a for loop required?

A

no, any of them can be left out if nothing needs to be done

139
Q

What is a break statement in a loop?

A

it forces the loop to terminate immediately without reevaluating the loop’s condition. so we can leave a loop while it’s condition is still true

140
Q

What is a continue statement in a loop?

A

This will cause the loop to stop running the current pass through the loop but will advance to the next pass, recheck the condition, and keep running if it’s still true

141
Q

Do all loops need break and continue statements?

142
Q

Can loops be nested in other loops?
Can loops and if statements be nested in each other?

A

yes and yes

143
Q

What is an array?
how is it indicated?
What is an index?

A

A collection of value stored in a single variable
with square brackets
the number of the value in the array

144
Q

Can an array contain elements of different types?
Can an array be any type?

A

No - each array contains only elements of a specific type
Yes

145
Q

How is an array variable declared and then constructed?

A

type[] varName = new type[count];
the new keyword creates new things in your program, the number at the end indicates how many values the array will hold

146
Q

Can an array be increased or decreased once it is constructed?
What similar tool works in the opposite way here?

A

No
Lists - they allow to add and remove items as needed

147
Q

What is 0-based indexing?

A

indexing starts at 0 instead of 13

148
Q

How do you read the current value in an array at a specific index?

A

using the index operator
scores[0]; - accesses the 0 index of the scores array

149
Q

What is every bit set to by the computer when a new array is created?
What does that mean for numeric types? bool? strings or characters?

A

0 - this automatically initializes every spot in an array
numeric - 0
bool - false
string and char - null

150
Q

What happens if you attempt to reach beyond the beginning or end of an array?
how can you identify the total values in an array?

A

an index out-of-range error
array.Length - the length property

151
Q

How can items relative to the end of an array be accessed?
does the end start at 0 as well?

A

by using the ^ symbol
scores[^1]; - gets the last item in the scores array
no from the end you start at 1

152
Q

What is the range operator?
how many values can it take?
are all the values required?

A

it allows you to grab a copy of a section of an array
three- the first number is the index to start at, followed by two periods, then the number to end at (end number is NOT included in the copy)
no, you can leave either or both numbers

153
Q

Can you use the ^ operator with the range operator?

154
Q

what happens if your endpoint is before your start point when using a range operator?

A

the program will crash

155
Q

How can you create an array with your own initial values?
what is this called?

A

by using curly brackets with each value separated by commas
int[] score = new int[3] {1,2,3};
collection initializer syntax

156
Q

What two main shortcuts exist when using collection initializer syntax based on the data inputted?

A

if you list all of the items for the array you can skip stating the length in the first place
int[] score = new int[] {1,2,3};
if the type of the values is clear enough for type inference you also don’t need to specify the type
int[] score = new [] {1,2,3};

157
Q

what is a foreach loop?
what is the syntax?

A

foreach keyword followed by parentheses that contain a variable that will hold each item in the array in turn, the in keyword separates the variable from the array to iterate over
int scores = new int[10]
foreach (int score in scores)

158
Q

What can a for loop do that a foreach loop can’t?

A

a foreach loop loses visibility into which index you’re at. a for loop will allow you to obtain the value and the index

159
Q

what is an array of arrays and why is it commonly used?

A

a jagged array. when each of the smaller arrays needs to be a different size

160
Q

What is an array that has more than one index called?
How are they denoted?
How can it be initialized?

A

multi-dimensional arrays or rectangular arrays
by placing at least two indices in the square brackets separated by commas
by using sets of curly braces inside other curly braces

161
Q

How do you declare a method and indicate it does not return a value?
What casing do programmers typically use for methods?

A

void MethodName(){
method body or statements to run;
}
UpperCamelCase

162
Q

What is the difference between a function and a method?
What is a function that is defined inside another function?

A

a function is any reusable, callable code block
a function is only also a method if it’s a member of a class.
local functions