• Home
  • Textbooks
  • C# Programming: From Problem Analysis to Program Design
  • Your First C# Program

C# Programming: From Problem Analysis to Program Design

Barbara Doyle

Chapter 2

Your First C# Program - all with Video Answers

Educators


Chapter Questions

00:48

Problem 1

ASP.NET creates which type of application?
a. Windows
b. console
c. command
d. Web
e. services

Ernest Castorena
Ernest Castorena
Numerade Educator
00:51

Problem 2

Which beginning symbol(s) identifies the following 10 lines as comments?
a. $\quad / *$
b. $* *$
c. $1 /$
d. / / /
e. $* 1$

Ernest Castorena
Ernest Castorena
Numerade Educator
00:29

Problem 3

System is an example of a(n):
a. object
b. class
c. method
d. namespace
e. directive

Ernest Castorena
Ernest Castorena
Numerade Educator
00:56

Problem 4

$\mathrm{A}(\mathrm{n}) \quad$ ______________ groups semantically related types under a single name.
a. object
b. class
c. method
d. namespace
e. directive

Ernest Castorena
Ernest Castorena
Numerade Educator
00:25

Problem 5

To mark the beginning and end of a block of code, C# programmers use:
a. [ ]
b. { }
c. ( )
d. begin... end
e. start... stop

Ernest Castorena
Ernest Castorena
Numerade Educator
00:41

Problem 6

Which of the following is a keyword?
a. Main( )
b. System
c. using
d. WriteLine
e. all of the above

Ernest Castorena
Ernest Castorena
Numerade Educator
00:39

Problem 7

Which of the following is a signature for a method?
a. Main( )
b. console.Writeline("Ok");
c. using Programming1
d. static System.Read ( )
e. none of the above

Ernest Castorena
Ernest Castorena
Numerade Educator
00:49

Problem 8

The fully qualified call to the method that allows the user to input a single character is:
a. Console. System. Read ( )
b. System.console.Read( )
c. Console. System.Write ( )
d. System. Console.Write (
e. System. Console.ReadLine( )

Ernest Castorena
Ernest Castorena
Numerade Educator
00:25

Problem 9

Source code must be translated into machine code (also called native code). This twostep process begins with a(n):
a. debugger
b. editor
c. interpreter
d. JITer
e. compiler

Ernest Castorena
Ernest Castorena
Numerade Educator
00:43

Problem 10

A(n) ___________ is a mock-up of desired output.
a. prototype
b. algorithm
c. diagram
d. specification
e. none of the above

Ernest Castorena
Ernest Castorena
Numerade Educator
00:25

Problem 11

Source code must be translated into machine code (also called native code). This twostep process begins with a(n):
a. debugger
b. editor
c. interpreter
d. JITer
e. compiler

Ernest Castorena
Ernest Castorena
Numerade Educator
01:16

Problem 12

To see the results of an application, you ___________ the code.
a. compile
b. JIT
c. execute
d. edit
e. desk check

Ernest Castorena
Ernest Castorena
Numerade Educator
00:53

Problem 13

A console application is characterized by:
a. containing a Main( ) class
b. containing a Main( ) method
c. featuring a GUI
d. belonging to the Web Forms class
e. requiring the use of a System.Interface namespace

Ernest Castorena
Ernest Castorena
Numerade Educator
00:25

Problem 14

Which escape sequence can be used to indicate the cursor should advance to the
next line?
a. newline
b. escape next
c. \n
d. \newline
e. \r

Ernest Castorena
Ernest Castorena
Numerade Educator
00:39

Problem 15

Which of the following is a call to a method?
a. Console.Write;
b. Console.Write[“ok”];
c. Write.Console(“ok”);
d. Console.Write(“ok”);
e. none of the above

Ernest Castorena
Ernest Castorena
Numerade Educator
01:33

Problem 16

Identify one syntax error that might occur when you type Example 2-1 into an editor. Identify one logic error that might occur.

Ernest Castorena
Ernest Castorena
Numerade Educator
01:15

Problem 17

What is produced when you run the following application?

Ernest Castorena
Ernest Castorena
Numerade Educator
00:49

Problem 18

What must be changed in the segment of code in Exercise #17 to cause all of the out- put to be displayed on one line?

Ernest Castorena
Ernest Castorena
Numerade Educator
00:53

Problem 19

Search the Internet and identify the URL of one site, other than Microsoft, that has a C# compiler available for download.

Ernest Castorena
Ernest Castorena
Numerade Educator
02:41

Problem 20

Using the program segment in Exercise #17, identify line number(s) in which each of
the following can be found:
a. method invocation
b. namespace
c. class name
d. argument to a method
e. comment
f. identifier

Ernest Castorena
Ernest Castorena
Numerade Educator
01:28

Problem 21

Identify the syntax error(s) (if any) in the following:

Ernest Castorena
Ernest Castorena
Numerade Educator
01:18

Problem 22

Explain the relationship between System, Console, and Read.

Ernest Castorena
Ernest Castorena
Numerade Educator
02:09

Problem 23

Think algorithmically.Write a set of instructions for each of the following activities. Your algorithm should be so complete that you could give it to other people, and they could perform the task specified without asking additional questions.
a. Make a peanut butter and jelly sandwich.
b. Walk to your next class.
c. Purchase a bottle of water from a vending machine.

Akash M
Akash M
Numerade Educator