Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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?

Input()
Next()
NextLine()
ReadLine()

Flag this Question

Question 3 2 pts

What can be used to control the appearance of text output?

A set placeholder
Carefully placed whitespace
A declared namespace
A defined format string

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?

namespace
format string
placeholder
whitespace

Flag this Question

Question 5 2 pts

In the C# statement moneyString = someMoney.ToString("F3"), what is "F3" an example of?

intrinsic type
standard numeric format string
named constant
literal constant

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?

static
fix
final
const

Flag this Question

Question 8 2 pts

What method can be used to accept user input from the keyboard on the console?

Input()
NextLine()
Next()
ReadLine()

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?

ToSingle()
ToByte()
ToInt16()
ToDecimal()

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?

Assign()
Parse()
Write()
Cast()

Flag this Question

Question 11 2 pts

What operator is used for exponentials in the C# programming language?

%

None of these answers

^
*

Flag this Question

Question 12 2 pts

If you do not provide an accessibility modifier for a method, it is private by default.

False
True

Flag this Question

Question 13 2 pts

Arrays, like all objects, are passed by value.

True
False

Flag this Question

Question 14 2 pts

What accessibility modifier limits method access to the class that contains the method?

protected
private
internal
protected internal

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?

nonstatic
internal
static
protected

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?

input
value
output
reference

Flag this Question

Question 17 2 pts

What is the return type of the ReadLine() method call?

Object
string
bool
int

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.

True
False

Flag this Question

Question 21 2 pts

When you use a reference parameter, any passed variable must have an assigned value.

False
True

Flag this Question

Question 22 2 pts

You cannot use the out or ref keywords when passing an array to a method.

True
False

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?

optional parameter
reference parameter
global parameter
value parameter

Flag this Question

Question 24 2 pts

What modifier is used to indicate that a parameter is used for output?

out
get
params
ref

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?

formal
optional
output
reference

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?

mandatory parameter
value parameter
reference parameter
output parameter

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?

reference parameter
output parameter
parameter array
value parameter

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?

polymorphic
hidden
ambiguous
overloaded

...

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

What items should be included in the audit status report?

Answered: 1 week ago

Question

How does Scrum help mitigate risk?

Answered: 1 week ago