DEVRY CIS170B all weeks quizes [ all 7 week quizes ]

Question # 00030291 Posted By: steve_jobs Updated on: 11/02/2014 02:27 PM Due on: 12/12/2014
Subject Computer Science Topic General Computer Science Tutorials:
Question
Dot Image

Question 1. Question : (TCO 1) Because information in _____ is lost when the power is turned off, that type of memory is considered _____.

: auxiliary storage, nonvolatile

auxiliary storage, volatile

RAM, nonvolatile

RAM, volatile

Comments:

Question 2. Question : (TCO 1) C# comments are represented by which characters?

: // and /* */

:: and //

// and >>

>

Comments:

Question 3. Question : (TCO 2) Which is not a C# syntax rule?

: C# is not case sensitive.

Blocks of code are defined by curly braces.

Statements must end with a semicolon.

Every C# program must have a function named "main."

Comments:

Question 4. Question : (TCO 1) _____ provides access to programming language definitions within the code editor.

: Intellisense

Bookmark

Break point

Step through

Comments:

Question 5. Question : (TCO 2) _____ enhances a programmer's productivity by providing editing, compiling, and debugging in one software package.

: An IDE

C#

Compiler+

MRE

Comments:

Question 6. Question : (TCO 2) The analysis phase of software development involves _____.

: determining a program's inputs and outputs and the process it will use to to solve the problem

writing the software with a program such as Visual Studio.NET C#

testing the solution

Both A and B

Comments:

Question 7. Question : (TCO 2) What escape sequence is used to produce a new line within a string literal on the output console?

: Special characters cannot be added to string literals

\t

\n

return character

Comments:

Question 8. Question : (TCO 2) What is the result of this code segment:

int doors = 2;

Console.WriteLine("The Car has {0}",doors);

: The Car has 2

The Car has {0} doors

The Car has 2 doors

The statement will not compile.

Comments:

Question 9. Question : (TCO 3) The proper operator precedence, from first to last, is _____.

: subtraction, addition, and multiplication

addition, subtraction, and multiplication

exponentiation, division, and subtraction

exponentiation, addition, and division

exponentiation, division, and multiplication

Comments:

Question 10. Question : IDE stands for Integrated Development Environment

: True

False

Comments:

Question 11. Question :

You can only code using camel casing in the hot desert.

: True

False

Comments:



week 2



uestion 1. Question :

(TCO 4) A car dealership is running a promotion that includes a 25% discount on last year’s models. Which of the following is the appropriate structure to use to determine if a given car fits the criteria for the discount?

Loop

Method

Decision

Sequence

Comments:

Question 2. Question :

(TCO 6) When using the Visual Studio, press _____ to start debugging your program.

F5

F10

F11

F15

Comments:

Question 3. Question :

(TCO 6) To cause the Visual Studio debugger to halt execution of your program at a particular statement, set a _____ at that statement.

Breakpoint

Locals

Debug

Watch

Comments:

Question 4. Question :

(TCO 4) How is a decision structure represented on a flow chart?

Square

Rectangle

Circle

Diamond

Comments:

Question 5. Question :

(TCO 4) The symbol && is an example of a C# _____ operator.

Relational

Boolean

Logical

Mathematical

Comments:

Question 6. Question :

(TCO 4) Given that a = 5, b = 6, and c = 8, which of the following is false?

a == 5

7 <= (a + 2)

c <= 4

(2 + a) != b

Comments:

Question 7. Question :

(TCO 4) What will be the output of this code?

int x = 5, y = 3;

if (x > y)

{

Console.Write("A, ");

if (x + 1 > y)

Console.Write("B, ");

else

Console.Write("C, ");

}

else

Console.Write("D, ");

A,

A, B,

A, D,

A, C,

Comments:

Question 8. Question :

(TCO 6) C# code that might create a problem at runtime can be placed in a _____ block. Code to deal with the problem is then placed in a _____ block.

catch, finally

catch, try

try, catch

try, finally

Comments:

Question 9. Question :

All IF statements contain a conditional expression that evaluates to true or false.

True False

Comments:

Question 10. Question :

Compile errors and run-time errors mean the same thing.

True False

Comments:

Question 11. Question :

This code is valid:

double var = 16.0;

if (var > 15 && var < 20)

Console.WriteLine("{0} is between 15 and 20", var);

else

Console.WriteLine("{0} is not between 15 and 20", var);

True False

Comments:

Question 12. Question :

2Score is a valid variable name in C#?

True False

Comments:




week 3


Question 1. Question :

(TCO 5) When writing a program, if you know exactly how many times statements in a loop should execute, use the _____ structure.

do while

for

goto

while

Instructor Explanation: With the FOR structure, the programmer specifies the number of iterations the loop will perform.

Points Received: 4 of 4

Comments:

Question 2. Question :

(TCO 5) When used within a loop structure, the _____ statement causes execution to jump out of the loop and proceed with subsequent statements in the program.

break

continue

goto

jump

Instructor Explanation: BREAK breaks completely out of the loop whereas CONTINUE transfers control to the loop’s conditional expression.

Points Received: 4 of 4

Comments:

Question 3. Question :

(TCO 5) A block of statements within the body of a FOR loop must be surrounded with _____.

curly braces {}

parentheses ()

square brackets []

None of the above

Instructor Explanation: Although a loop body containing a single statement needs no braces, several statements must be surrounded with curly braces.

Points Received: 4 of 4

Comments:

Question 4. Question :

(TCO 5) What output will this set of statements produce?

int a = 1;

while (a < 1)

{

Console.Write("{0}\t", a);

a++;

}

Console.Write("{0}\t", a);

An infinite loop

An exception

1

1 1

Instructor Explanation: Because “a” will never be less than 1, the WHILE loop will not execute. The value of “a” will remain 1.

Points Received: 4 of 4

Comments:

Question 5. Question :

(TCO 5) In this code, the inner FOR loop _____.

int i = 1, j = 1;

for (i = 1; i < 4; i++)

{

for (j = 1; j < 4; j++)

{

Console.Write("{0}{1} ", i, j);

}

}

contains a syntax error

is nested

is like a blue sky

is like a light

Instructor Explanation: The inner FOR is nested inside the outer FOR, so for every execution of the outer FOR, the inner FOR will execute three times.

Points Received: 4 of 4

Comments:

Question 6. Question :

(TCO 5) Your program keeps asking for last names from the user until he/she enters “####.” In this context, the “####” is used as a(n) _____.

accumulator

counter

sentinel value

test value

Instructor Explanation: A sentinel value is a dummy variable not used for processing. It’s used to signify when a loop should stop executing.

Points Received: 4 of 4

Comments:

Question 7. Question :

GOTO statements should be avoided.

True False

Instructor Explanation:

Yes, since they are often result in unstructured and confusing code. Break and Continue is a much better choice.

Note that GOTO usually works with a Label.

Points Received: 4 of 4

Comments:

Question 8. Question :

A walkthrough is a form of software peer review the programmer leads members of the development team through the software code, and the participants ask questions and make comments about possible errors, problems of not adhering to development standards, and other problems.

True False

Points Received: 4 of 4

Comments:

Question 9. Question :

Accumulators and counters mean the same thing.

True False

Points Received: 4 of 4

Comments:

Question 10. Question :

Nesting or indenting multiple programming loops is a good coding practice.

True False

Points Received: 4 of 4

Comments:

Question 11. Question :

The For Loop is used when the user wishes to stop the Loop from executing, and is used when the number of Loop Executions is unknown.

True False

Points Received: 4 of 4

Comments:



week 4



(TCO 8) Which words belong in the blank to indicate that the method PerformCalcs() returns an integer to the calling method, and that the method has no restrictions on accessibility?

_____ PerformCalcs()

private static int

public static int

private static void

public static void

Comments:

Question 2. Question :

(TCO 7) Which is not a valid name for a method or function?

1mod

mod_1

MyMod

mod1

Comments:

Question 3. Question :

(TCO 8) The following method has _____ input parameter(s) and returns _____ to the calling method.

Public static int GetResult(int value1, double value2)

2, an integer

2, no value

an integer, an integer

1, an integer

Comments:

Question 4. Question :

The following will return a value of type int:

public static int CalcDiff(int price1 , int price2);

True False

Comments:

Question 5. Question :

The following code is correct:

int myInteger = getWidgets(int myWidgets)

True False

Comments:

Question 6. Question :

Overloaded methods must share the same name and the parameters they accept must differ in number and/or data type. They can return different data types.

True False

Comments:

Question 7. Question :

Local variables can only be accessed by the method that declares them. Global variables can be accessed by any method.

True False

Comments:

Question 8. Question :

void means that the method has a return value.

True False

Comments:

Question 9. Question :

In the code below, Math is a Class:

Math.Sum();

True False

Comments:

Question 10. Question :

My mod is a valid method name

True False

Comments:



week 5




(TCO 11) An array is a list of data items that _____.

share the same data type

are all integers

have different faces

the different flavors

Comments:

Question 2. Question :

(TCO 11) Which statement is true about this array declaration?

int [] myArray = {1,4,3,5,6};

It declares a 5 dimensional array.

The size of the array is five.

It sets the element myArray[1] to 1.

It won't compile due to a syntax error.

Comments:

Question 3. Question :

(TCO 11) What will be the output of this code?

int[] size = {2,3,5,6,4,5};

Array.Sort(size);

foreach (int

val in size)

Console.Write("{0} ", val);

2 3 5 6 4 5

5 4 6 5 3 2

6 5 5 4 3 2

2 3 4 5 5 6

Comments:

Question 4. Question :

(TCO 11) When a single array element, such as myArray[2], is passed to a method, the method receives _____.

a copy of the array

the starting address of the array

the address of the element

a copy of the value in the element

Comments:

Question 5. Question :

(TCO 12) The size of a(n) _____ must be determined when the program is written, whereas elements of a(n) _____ can be added or deleted at runtime.

array, ArrayList

ArrayList, array

array, Array class

ArrayList, Array class

Comments:

Question 6. Question :

(TCO 12) In your program, myList was declared as an ArrayList. To append the number 7 to the end of myList, write _____.

myList.Add(7);

myList.Append(7);

myList.Insert(7);

myList.Set(7);

Comments:

Question 7. Question :

This is a valid statement:

decimal [] price = new decimal[5];

True False

Comments:

Question 8. Question :

In the following, we can code height[1,1] in a two-dimensional array that will have values

like this (this is partial code): height = { {2.1, 3.2, 6.5, 7.2},

{5.4, 6.7, 3.5, 3.6} };

True False

Comments:

Question 9. Question :

The following is valid code for a one-dimensional array:

int[] size = {2,3,5,6,4,5};

True False

Comments:

Question 10. Question :

ArrayList “Count” property to give the user the current number of integers with a value of '1' in TempArray.

True False




week 6



Question 1. Question : (TCO 9) A(n) _____ is a notification from the _____ that an action has occurred, such as a mouse click or a key press.

event, operating system

console application, operating system

GUI application, event

event, GUI application

Comments:

Question 2. Question : (TCO 9) Although a _____ usually accepts text input from the user, it can also be used to display text.

ComboBox

Label

MessageBox

TextBox

Comments:

Question 3. Question : (TCO 9) The first time a programmer double-clicks on a TextBox object in Design Mode, the TextBox’s default event handler method _____ is added to the code.

Click()

Enter()

Text()

TextChanged()

Comments:

Question 4. Question : (TCO 9) Type _____ to append “New Year’s Day” to an existing list of holidays in the “listHolidays” ListBox object at runtime.

listHolidays.Items.Add(“New Year’s Day”);

listHolidays.Items.Append(“New Year’s Day”);

listHolidays.Add(“New Year’s Day”);

listHolidays.Append(“New Year’s Day”);

Comments:

Question 5. Question : (TCO 9) Which of the following statements will retrieve the selected item of a ComboBox called “cmboWines” and place it in a string variable called “str”?

string str = cmboWines.SelectedItem;

string str = cmboWines.Selection();

string str = cmboWines.Text;

string str = cmboWines.getText();

Comments:

Question 6. Question : A Button is also known as a Form Control.

True

False

Comments:

Question 7. Question : Form controls include Buttons, Needles, Labels, and Textboxes.

True

False

Comments:

Question 8. Question : A Label object is normally used to provide descriptive text or a label for another control.

True

False

Comments:

Question 9. Question : Because it is the most common event associated with a Form, the default event handler method for a Form object is Load().

True

False

Comments:

Question 10. Question : The Text property determines the text that will appear on a Label when the Windows application starts running.

True

False

Comments:



week 7



(TCO 13) Include the _____ namespace in your C# program to enable it to access files and directories.

Student Answer: System.IO

System.Collections.Generic

System

System.Text

Comments:

Question 2. Question :

(TCO 13) Before your C# program attempts to open a file, it should first _____.

Student Answer: call File.Open() to make sure the file can be opened

call File.Exists() to make sure the file exists

call File.Create() to create the file

call File.Close() to close the file in case it was already open

Comments:

Question 3. Question :

(TCO 13) To make your C# program put a new file called "newFile.txt" in the current directory, write _____.

Student Answer: File.Create("newFile.txt");

File.CreateNew("newFile.txt");

File myFile = new File("newFile.txt");

File myFile = new FileStream("newFile.txt");

Comments:

Question 4. Question :

(TCO 13) The following C# code will print out _____.

DirectoryInfo dir = new

DirectoryInfo(".");

foreach (FileInfo

fil in dir.GetFiles("*.*"))

Console.WriteLine(fil.Name);

Student Answer: the names of all objects in a program

the names of the methods in a program

the names of all of the variables in a program

the names of all files in the current directory

Comments:

Question 5. Question :

The GetCreationTime() method of the File class returns a string containing the date and time a specified file was created.

True False

Comments:

Question 6. Question :

The StreamReader and StreamWriter classes simplify the process of reading and writing to text files.

True False

Comments:

Question 7. Question :

Because many runtime errors are possible when accessing system resources such as files, it is not important to catch and handle exceptions that may be thrown.

True False

Comments:

Question 8. Question :

The Close() method of the SystemWriter class causes any data in the buffer to be written to the file, and releases any resources associated with the file, such as memory.

True False

Dot Image
Tutorials for this Question
  1. Tutorial # 00029739 Posted By: steve_jobs Posted on: 11/02/2014 02:28 PM
    Puchased By: 4
    Tutorial Preview
    The solution of DEVRY CIS170B all weeks quizes [ all 7 week quizes ]...
    Attachments
    devry_cis170_all_quizes.zip (151.73 KB)
    Recent Feedback
    Rated By Feedback Comments Rated On
    dc...313 Rating Secure-payment gateways 12/08/2015
    w...ly Rating High-standards services 03/23/2015

Great! We have found the solution of this question!

Whatsapp Lisa