Question
C# 1. Sorting, what is it good for? (Choose all that apply) Searching Merging UIs Grouping Decision Making 2. Arrays are great for dealing with
C#
1. Sorting, what is it good for? (Choose all that apply)
Searching
Merging
UIs
Grouping
Decision Making
2. Arrays are great for dealing with variable quantities of data
True
False
3. How would I declare a variable of this type?
public enum Powers |
{ |
Strength, |
Smarts, |
Flight, |
Speed, |
Swimming, |
Invisibility |
} |
enum Powers = Powers.Speed;
Powers.Speed = myPowers;
Powers myPowers = Speed;
Powers myPowers = Powers::Speed;
Powers myPowers = Powers.Speed;
4. What will the following code display?
class Animal |
{ |
public void Show() { Console.Write("Animal"); } |
} |
class Dog : Animal |
{ |
public void Show() { base.Show(); Console.Write("Dog"); } |
} |
|
|
Animal dog = new Dog(); |
dog.Show(); |
Dog
DogAnimal
this
Animal
5. Who besides the class itself can directly access a classes' private sections?
Main
children and parents
parents
no one
6. When a class is defined WITHIN another class, the inner class is...
nested
generic
a child
static
7. What will the following code print out?
int[] array = { 2, 4, 8, 11, 16, 27, 32 }; |
|
for (int i = 0; i < array.Length; i++) |
Console.Write(array[i] % 2 == 0 ? 0 : 1); |
0001010
1110101
0010110
0101010
8. When class B inherits from class A, what do you call the A/B combo?
kid/mom
prefix/postfix
binary/unary
base/derived
9. How would you check if the variable car is a Minivan type?
if ( car == Minivan)
if ( car = Minivan)
if ( car as Minivan )
if ( car is Minivan )
10. A recursive method needs what to prevent an infinite loop?
break;
continue;
an exit condition
i++
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started