When writing C# code, how do you indicate a namespace?
| You must use create a file called "namespaces", and include all namespace code in this file. Then, the namespace can be used by name in your program. |
| You must use the "declare namespace" keywords, followed by the namespace. |
| You must utilize the using clause, or using directive, by specifying "using", followed by the namespace. |
| You must specify the namespace by using the "namespace" keyword, followed by the namespace. |
Flag this Question
Question 2 2 pts
What method can be used to accept user input from the keyboard on the console?
Flag this Question
Question 3 2 pts
What can be used to control the appearance of text output?
| Carefully placed whitespace |
Flag this Question
Question 4 2 pts
What uses curly braces containing a number that indicates the desired position for a variable in a list that follows a string used for formatting purposes?
Flag this Question
Question 5 2 pts
In the C# statement moneyString = someMoney.ToString("F3"), what is "F3" an example of?
| standard numeric format string |
Flag this Question
Question 6 2 pts
How is a Boolean variable declared in a program?
| A bool type variable must be declared, followed by the bool value. |
| A char type variable must be declared, followed by the bool value. |
| An int type variable must be declared, followed by the bool value. |
| A boolean type variable must be declared, followed by the bool value. |
Flag this Question
Question 7 2 pts
What keyword can be used to create a named identifier for a memory location whose contents cannot change?
Flag this Question
Question 8 2 pts
What method can be used to accept user input from the keyboard on the console?
Flag this Question
Question 9 2 pts
What method from the Convert class can be used to convert a specified value to an 8-bit unsigned integer?
Flag this Question
Question 10 2 pts
What method can be used as an alternative to the Convert class methods to change a string into a number?
Flag this Question
Question 11 2 pts
What operator is used for exponentials in the C# programming language?
Flag this Question
Question 12 2 pts
If you do not provide an accessibility modifier for a method, it is private by default.
Flag this Question
Question 13 2 pts
Arrays, like all objects, are passed by value.
Flag this Question
Question 14 2 pts
What accessibility modifier limits method access to the class that contains the method?
Flag this Question
Question 15 2 pts
What keyword modifier indicates that a method can be called by referring to the class rather than an object from the class?
Flag this Question
Question 16 2 pts
A formal parameter that receives a copy of the value passed to it is an example of what type of parameter?
Flag this Question
Question 17 2 pts
What is the return type of the ReadLine() method call?
Flag this Question
Question 18 2 pts
Under what circumstances will a method receive the actual memory address of a passed array, and have access to the actual values in the array elements?
| Only when it is passed by reference. |
| Only when the array is inherited. |
| Only when the array is within the method's scope. |
| Only when it is passed by value. |
Flag this Question
Question 19 6 pts
Match each item with a statement below.
A method that calls another method.
A method call that requires an object reference.
A variable that is declared in the current method and is known only to that method.
A parameter that receives a copy of the value passed to it.
Variables that are declared within a class but outside of a method.
A name that includes the class name.
The return type for a method that returns either true or false.
Consists of the data types and parameter names that appear between parentheses in a method header.
A method that is called without an object reference.
Flag this Question
Question 20 2 pts
To ensure that the original value of an argument passed to a method remains unchanged after returning from the method, you should use a reference parameter or an output parameter.
Flag this Question
Question 21 2 pts
When you use a reference parameter, any passed variable must have an assigned value.
Flag this Question
Question 22 2 pts
You cannot use the out or ref keywords when passing an array to a method.
Flag this Question
Question 23 2 pts
On occasion, you might want a method to be able to alter a value you pass to it. What type of parameter should you use in this case?
Flag this Question
Question 24 2 pts
What modifier is used to indicate that a parameter is used for output?
Flag this Question
Question 25 2 pts
What type of parameter requires that the argument used to call the method must have an assigned value?
Flag this Question
Question 26 2 pts
For the sake of convenience, what parameter type can be used when the variable to be passed does not have an assigned value at the time the method is called?
Flag this Question
Question 27 2 pts
How can you avoid throwing an exception during data conversion when a value cannot be converted to an appropriate type?
| You can use the Convert() method to force the conversion. |
| You can use the TryParse() method to attempt conversion, or assign a 0 to the variable if it is not possible. |
| You can use the Parse() method, which may result in garbage being returned. |
| You can use the ReadLine() method to convert the data to a string. |
Flag this Question
Question 28 2 pts
What should you utilize when you don't know how many arguments you might eventually send to a method?
Flag this Question
Question 29 2 pts
What is a method considered to be when there is a potential for a situation in which the compiler cannot determine what method to use?
...