click below
click below
Normal Size Small Size show me how
IST quiz Qs
| Question | Answer |
|---|---|
| A(n) _________ is an unexpected error that occurs while a program is running, causing the program to halt if the error is not properly dealt with. | exception |
| What is the purpose of a try-catch statement? | To respond to exceptions when they are thrown, and prevent the program from abruptly crashing. |
| A _______ structure executes a set of statements only under certain circumstances. | decision |
| A ______ structure provides one alternative path of execution. | single-alternative decision |
| A(n) _______ expression has a value of either true or false. | Boolean |
| The symbols >,<, and == are all ________ operators | relational |
| You use a(n) ______ statement to write a single-alternative decision structure. | if |
| &&, ||, and ! are _______ operators. | logical |
| The _______ operator takes a Boolean expression as its operand and reverses its logical value. | ! |
| You can write any program using only sequence structures. | False |
| A compound Boolean expression created with the && operator is true only when both subexpressions are true. | True |
| Print "Hello World" if x is greater than y. | int x=50 int y=10 if (x>y) { Console.Writeline("Hello World"); } |
| The TryParse family of methods can be used to convert a string to a specific data type without throwing an exception. | True |
| A decision structure can be nested inside another decision structure. | True |
| A ______ structure tests a condition and then takes one path if the condition is true or another path if the condition is false. | dual-alternative decision |
| The following loop displays ________ for (int i = 1; i <= 10; i++) { Console.Write(i + " "); i++; } | 1 3 5 7 9 |
| The following code will print "Welcome to C sharp" for 10 times int count = 0; while (count++ < 10) { Console.WriteLine("Welcome to C sharp"); } | True |
| How do you display a quote mark in Console App template? | Console.WriteLine("\""); |
| Which statement is used to stop a loop? | break; |
| The first value printed in the Console will be? int counter = 0; while (counter < 100) { Console.WriteLine(counter); counter++; } | 0 |
| If a do-while loop’s condition is false initially, the loop’s body may not run at all. | False |
| A ______ structure provides one alternative path of execution. | single-alternative decision |
| A(n) _____ expression has a value of either true or false. | Boolean |
| A _______ decision structure is written inside another decision structure. | nested |
| The _____ section of a switch statement is branched to if none of the case values match the test expression. | default |
| A ListBox’s index numbering starts at _______. | 0 |
| The ______ is a collection of statements enclosed inside a set of curly braces that are performed when the method is executed. | method body |
| The do-while loop is known as a pretest loop, which means it tests its condition before performing an iteration. | False |
| The keyword "continue" immediately jumps to the next iteration of the loop. | True |
| The method header, which appears at the beginning of a method definition, lists several important things about the method, including the method’s name. | True |
| When you call a(n) _____, it simply executes the statements it contains and then terminates. | void method |
| Array indexes start with: | 0 |
| Which method will wipe out all text on the screen? | Console.Clear(); |
| Which keyword is used to return a value inside a method? | return |
| void means that a method does not have a return value. | True |
| A ____________ is commonly used to control the number of times that a loop iterates. | counter variable |
| The term ___________ is used to describe a file that data is written to. | output file |
| When you work with a __________ file you access data from the beginning of the file to the end of the file. | sequential access |
| What is contained in the body of a loop? | A statement or series of statements in a loop that are executed if the Boolean expression is true. |
| The symbols >, <, and == are all ___________ operators. | relational |
| You use a(n) _________ statement to write a dual-alternative decision structure. | if-else |
| A __________ decision structure is written inside another decision structure. | nested |
| A compound Boolean expression created with the ___________ operator is true if either of its subexpressions is true. | || |
| If several ________ controls exist in a GroupBox, only one of them may be selected at a time. | RadioButton |
| The while loop is known as a pretest loop, which means it tests its condition before performing an iteration. | True |
| To append data to an existing file, you open it with the File.AppendText method. | True |
| If an item is not selected in a ListBox, the control’s SelectedIndex property will be set to 0. | False |