CSC 215 Study Guide
CSC 215 Study Guide
Answer Key
1. An imperative statement is a command that tells the computer to perform a specific action without relying on any prior conditions being
met. It is a direct instruction that the computer executes.
2. A subroutine is a sequence of programmed instructions that performs a specific task as a unit, and it can also be called a procedure,
function, or subprogram. It allows for modularity and code reuse.
3. Numeric data types represent numbers that can be used in mathematical calculations using standard operations. Examples include exam
marks, lengths, prices of goods, and populations.
4. The modulus operator (or mod) finds the remainder of a division operation. It returns the value left over after performing division.
5. A loop is a programming construct that allows a set of instructions to be executed repeatedly, either for a specific number of times or until a
certain condition is met.
6. Floating-point numbers represent numbers with a decimal point, where the position of the point can vary; therefore, they can represent a
wider range of values than integers.
7. String literals are typically enclosed in double quotation marks (e.g., "Hello World").
8. The keywords are Private, which declares a local variable, Static, which declares a variable that persists across procedure calls, and Public,
which declares a variable accessible from anywhere in the project.
9. ByRef passes an argument by reference, meaning changes to the argument inside the procedure will affect the original variable. ByVal
passes an argument by value, creating a copy so changes don't affect the original.
10. Try...Catch...Finally is used for error handling. The code in the Try block is monitored, Catch handles any exceptions that occur, and Finally
executes regardless of whether an exception was thrown or not.
Essay Questions
Instructions: Answer the following questions in essay format, drawing upon the provided source material.
1. Compare and contrast the use of For...Next loops and Do...Loop structures in Visual Basic .Net. Include specific examples of when one might
be more appropriate than the other.
2. Discuss the various data types available in Visual Basic .Net. Describe the storage allocation, value ranges, and use cases for at least five
different data types (numeric, string, and Boolean).
3. Explain the concept of object-oriented programming as it relates to Visual Basic .Net, including the use of classes, objects, and member
functions. Provide a detailed example.
4. Describe the importance of error handling in programming, and outline the mechanisms provided by Visual Basic .Net for handling
exceptions.
5. Compare and contrast the use of functions and subroutines in Visual Basic .Net, using specific examples to illustrate their different purposes.
ByRef: A keyword used to pass an argument by reference to a procedure, allowing the procedure to modify the original variable.
ByVal: A keyword used to pass an argument by value to a procedure, passing a copy of the original value, and changes within the procedure do
not affect the original variable.
Class: A blueprint for creating objects, defining the data and methods that an object will have.
Compiler Directives: Instructions given to the compiler to preprocess the code before actual compilation.
Data Type: A classification that specifies the type of value a variable can hold (e.g., integer, string, boolean).
Do Loop: A loop structure that repeats a block of code either while a condition is true or until it becomes true.
Floating-point Number: A number with a decimal point; the position of the point can 'float', allowing for a wide range of values.
For Loop: A loop structure that repeats a block of code a specified number of times, using a counter variable.
GUI: (Graphical User Interface) A type of user interface that allows users to interact with devices through graphical icons and audio indicator,
rather than through text.
Imperative Statement: A statement that directly instructs the computer to perform an action, regardless of any existing condition.
Integer: A whole number, that can be positive or negative but without a fractional component.
Literal: A fixed value written directly into source code (e.g., 10, "hello").
Object: An instance of a class, representing a specific entity with defined properties and actions.
Procedure: A block of code that performs a specific task (e.g. subroutine, function).
Subroutine: A sequence of programmed instructions that performs a specific task as a unit, often called a procedure, function, or subprogram.
String: A data type that represents a sequence of characters (e.g., a text message).
Try...Catch...Finally: A block of code used for error handling, where Try monitors code, Catch handles errors, and Finally always executes.
Variable: A named storage location in memory that can hold a value, that value can be changed during program execution.