stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Programming II - Exam 1 Review Flashcards | StudBud
Explore
/
Programming II - Exam 1 Review
Programming II - Exam 1 Review
70 terms
·
StudBud Administration
·
91 plays
C# programming exam review.
Flashcards
70 cards
F
Practice quiz
P
Host live
L
Questions
70
Answers
1
What is wrong with the variable name “321_liftoff”?
Variable names cannot begin with numbers.
Variable names must begin with a letter.
There is nothing wrong with that variable name.
Variable names cannot contain underscores (_).
2
What is the escape character for inserting a tab?
\tab
\-
\>
\t
3
What three math operators are executed first? What two operators are executed last?
First are +, /, and -. Last are * and %
First are *, /, and %. Last are + and -
All operators execute from left to right.
First are +, -, and %. Last are * and /
4
What method can be used to convert a string to a numeric data type?
Parse()
ToNumber()
Convert()
You can directly cast from string to a number.
5
What language is often used for Rapid Application Development (RAD)?
C#
Java
C++
Visual Basic
6
What is an “if” statement used for in a program?
To ask the user a question.
To execute a block of code if a condition is false.
To execute a block of code in a loop.
To execute a block of code if a condition is true.
7
What is white-space?
Spaces, tabs, carriage returns, used to organize code.
The pixel padding needed for white pixels.
Text that is colored white when displayed to the user.
Symbols like "-" and "_" used instead of spaces.
8
How would you declare a boolean variable named isAccepted and initialize is with a false value?
bool isAccepted = true;
bool isAccepted = false;
bool isAccepted = 1;
bool isAccepted = 0;
9
Microsoft’s program to ensure that all Windows applications have the same look-and-feel:
Microsoft Windows Logo
Microsoft Programming Compliance
Windows Common Components
Windows Standards
10
Which of these is the C# logical operator for "and"?
||
&&
!
^
11
What is a constant variable?
Variable with special naming rules that must be followed.
Variable that can only hold whole integer data.
All of these are true.
Variable whose value can never be changed within a program.
12
What keyword can be used to exit a loop immediately regardless of the test condition?
break
stop
exit
halt
13
What do operator precedence rules determine?
The mathematical operations carried out by one operator.
The order entire statements will execute (flow control).
Order of execution of multiple mathematical operators.
The effect that parentheses have on an expression.
14
Which IDE will we be using this year to write C# programs?
Xamarin Studio
Visual Studio
MonoDevelop
SharpDevelop
15
What is the biggest advantage of compiling a program to an intermediate language?
It shows errors in your code more clearly
It takes less time than compiling to machine code
The same program can be distributed to multiple platforms
It hides your internal code secrets from others
16
Which characters are used to designate the body of an if() statement or loop?
[ ]
< >
{ }
( )
17
Select TWO programming languages that commonly use the .NET Framework.
C#
C++
Java
Visual Basic
18
Which two math functions get the next biggest or smallest whole number from a real number?
Floor()
Min()
Max()
Ceiling()
19
What are the only two possible results of evaluating a logical expression?
0 or 1
pro or con
yes or no
true or false
20
What is an IDE?
A central place to write, build, run, and debug code
A tool to help you figure out what kind of program to write
Important Development Engine (IDE)
Integrated Debug Effort (IDE)
21
What are comments used for in a program?
Helps the programmer understand the code.
Fixes compile-time errors as they occur during run-time.
Explains things to the user.
None of these.
22
Which of the following best describes the .NET Framework?
Library of pre-built functions for Linux and Mac OSX
All of these are true
Library of pre-built functions accessed by many languages
A safety net designed to catch program crashes
23
In Visual Studio, what is an easy way to add code to a button control's click method?
Change the button control's name property to btnClickEvent.
Double-click on the form while in the Design Tab.
Double-click the button control while in the Design Tab.
Create a boolean called Button_Click and initialize it.
24
Which of these is the C# logical operator for "or"?
^
||
&&
!
25
Which of these is not a comparison operator?
=
<=
>
<
26
What is the intermediate form of a compiled .NET application called?
A class file
Native machine code
Common Intermediate Language (CIL)
Complete Intermediate Logarithm (CIL)
27
Which computer had the first graphical operating system?
Windows
Lisa
Unix
Android
28
What is the meaning of the C# name?
C-like Object Oriented Language
Next generation Java
A note above C
A shorter version of C++
29
What version of Windows was the first fully 32-bit operating system?
Windows 8
Windows NT
Windows 7
Windows 3.0
30
What invention made the use of graphical programs faster and easier?
Sound cards
Keyboards
DVD discs
The computer mouse
31
Self-documenting code is
a Visual Studio feature which comments for you as you write.
a feature of some IDEs, but not available in Visual Studio.
code the original programmer has documented himself/herself.
a format for naming variables explaining what they do.
32
Replace("p", "t") returns a new string where all the "p" characters are now "t" characters.
False
True
33
What method is used to return a string representation of any data type?
MakeString()
String()
ToString()
GetString()
34
What are namespaces?
The names of your projects within the Solution Explorer.
Groups of commonly used objects and methods.
A pattern for naming your source files on disk.
Directories in which you organize your projects.
35
More than one control can share the same name as long as they are different types of controls.
True
False
36
What type of “while” loop will always be executed at least once?
while() loop
Both of these will always execute at least once.
Neither of these will execute at least once.
do while() loop
37
Which data type is used to hold only a "true" or "false" value?
double
int
bool
string
38
How do you compare two strings to see if they are the same? Is it case sensitive?
Compare(); yes it is case sensitive
IsEqual(); no it is not case sensitive
Equals(); yes it is case sensitive
Equals(); no it is not case sensitive
39
Name one mathematical constant that is pre-defined in the .NET Framework.
GRAVITY
DIAMETER
PI
INFINITY
40
How would you create a string that contains a double-quote as part of the text?
string myString = "I said, "Go!"";
string myString = "I said, ""Go! "";
string myString = "I said, \"Go!\ "";
You cannot embed double quotes into a string.
41
What language allows you to write a program once and run on many different operating systems?
Visual Basic
Java
ANSI C
C++
42
Why is it important to give forms and controls meaningful names?
Projects wont build unless you name each form and control.
The IDE wont create unique names; it’s up to you.
So you can identify the purpose of a control in your code.
You can’t create an event handler without a meaningful name.
43
When was the first version of Windows released?
2001
1990
1976
1985
44
What type of loop never stops executing?
recursive loop
infinite loop
for() loop
while() loop
45
What language was created by Microsoft as an answer to Java?
C++
C#
Visual Basic
ANSI C
46
Which of the following best describes a variable?
Names given to blocks of code within your program.
Named places to store data in your program.
A description of an object.
An unpredictable piece of code.
47
How would you declare a character variable named myChar and initialize it with the letter 'A'?
Dim myChar As Char = "A"
myChar char = 'A';
character myChar = 'A';
char myChar = 'A';
48
What is the endline character that goes at the end of most lines of C# code?
Solidus /
Semicolon ;
Bracket ]
Curly-brace }
49
What IBM operating system was an early competitor to Windows?
Unix
Lisa
DOS
OS/2
50
How do you access the first and last character of myString of length 5?
myString[0] and myString[5]
myString[1] and myString[5]
myString[0] and myString[4]
myString[1] and myString[4]
51
What was the name of the original, text-based operating system for home computers?
DOS
Windows
Mac OS
Lisa
52
Which one of the following is an advantage of the C# language over the C language?
C# contains automatic memory management
C# supports the .NET Framework
All of these are advantages
C# is an object-oriented language from the ground up
53
What is C#'s end-line character?
,
;
:
.
54
Value of dblNum after this line of code? dblNum = (1 + (3 * 4 / 6)) / 2;
1.33
1.5
1.0
4.75
55
What is the difference between a “signed” data type and an “unsigned” data type?
Signed integers can also hold real (fractional) values.
Signed data types can hold numbers less than zero.
Signed data types can hold a larger positive number.
Unsigned data types have no variable name (anonymous).
56
Which data type would be the BEST choice for storing the number -18.2359014?
double
char
byte
int
57
Which of the following statements add 3 to intNum?
intNum = intNum + 3;
intNum += 3;
All of these add 3 to intNum.
intNum++; intNum++; intNum++;
58
How do parentheses help to clarify a math statement?
Both of these are true.
Parentheses execute first regardless of precedence rules.
Neither of these are true.
Parentheses make it more obvious to humans what will happen.
59
What does a “while” loop do?
Executes as long as some logical expression is true.
Executes a block of code a fixed number of times.
Executes a block of code until the user decides to quit.
Executes until some logical expression becomes true.
60
What function is used to change all of the letters in a string to upper-case characters?
ToUpper()
MakeUpperCase()
Transform(String.Upper)
ToString(String.Upper)
61
Value of intNum after the following line of code? int intNum = 1 + 3 * 4 + 6 / 2;
16
20
12
22
62
In what form do computers store all data?
Text
Decimal (0 through 9)
Alphanumeric
Binary (1's and 0's)
63
Value of intNum after this line of code? intNum = (1 + 3) * 4 + (6 / 2);
16
20
19
12
64
What do “myResult1” and “myResult2” contain after the following code runs?
“my” and “Thip ip my ptring”
“my” and “Thip”
“m” and “This is my string”
“This is ” and “This is my ptring”
65
Which statement declares and initializes an “int” variable named “myVar” with the value -4765?
myVar int = -4765;
int myVar = -4765;
int -4765 = myVar;
integer myVar = -4765;
66
What is a “for” loop?
Loop that executes a block of code a fixed number of times.
Loop that will never exit.
Loop that uses a string index variable.
Loop that exits when the user selects the right value.
67
In Visual Studio, where would you go to add a new control to your Windows form?
Properties Window
Toolbox Window
Solution Explorer
Error Window
68
ToUpper() returns a new string where the contents have been converted to lower case.
True
False
69
What was the original name Microsoft came up with for the C# programming language?
COOL
D
C++
C-BETTER
70
What is one of the main differences between text boxes and labels?
Text boxes can be edited by the user, and labels cannot.
They are basically the same control.
Labels can be edited by the user, and text boxes cannot.
Text boxes are only single-line, labels are multi-line.