UBC CPEN 223 – FINAL Practice Test Exam GRADED A+ with Revised Q & A 2023/2024 VERIFIED
3 C's for "good Software" correct answers - Correct (safe
... [Show More] from bugs)
- Comprehensible (easy to understand)
- Changeable (ready to change)
Static Checking correct answers The checking that is done at compilation.
- Bug automatically found before program runs
Dynamic Checking correct answers The checking that is done at run time.
- Found automatically
Benefits of C# correct answers -Safety
> Type safe, static checking, exception handling, etc
- Ubiquity
> Multiplatform: Mobile, Web, Windows/Mac/Linux
- Elegance
- Popular
- Powerful
- High-level
- Modern object oriented
Issues with C# correct answers - Verbose: takes a lot of code to do simple task
- Large: many features
static void Main() correct answers The starting place of a program
int varName = 92; correct answers Declaring an int type variable
double VarName = 1.45; correct answers Declaring a double type variable
char varName = '*'; correct answers Declaring a char type variable
Two categories of C# types correct answers - Value types
- Reference types
C# operators correct answers - arithmetic ( +, -, /, % (remainder), *)
- comparison (==, !=, >, >=, ...)
- conditional (&&, ||, !)
C# selection statements correct answers - if(condition)
- else if(condition)
- switch *an alternative to if-else statements
C# repetition statements correct answers - while
- for
- do-while
Class correct answers The most important user defined type
- Contains two types of members;
> Data members (fields, ..) that store the data within the ______.
> Function members (methods, constructors, ...) that perform operations on the data
Methods correct answers A block of code that contains a series of statements.
Arrays correct answers stores a fixed-size collection of elements
How to initialize an array correct answers int[] nameOfVariable = new int[5];
- The size of the ______ is 5.
int [] nameOfVariable = new int[] {1, 2, 3, 4, 5};
int [] nameOfVariable = {1, 2, 3, 4, 5};
What is a Data Type? correct answers A _____ is a set of values and the operations that are permitted on the values
Value pre-defined types correct answers - int
- long
- double
- char
- uint
- bool
- decimal
- bool
- byte
- sbyte
- float
- uint
- short
- ushort [Show Less]