Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Quiz 2 for COSC 235, Fall 2008 by David A. Sykes - Prof. David A. Sykes, Quizzes of Computer Science

A quiz for students enrolled in cosc 235, fall 2008. The quiz covers various topics in software development, python programming, and control structures. Students are required to number the activities in software development, identify invalid identifiers, explain python keywords, output program results, and understand control structures.

Typology: Quizzes

Pre 2010

Uploaded on 08/17/2009

koofers-user-0mf
koofers-user-0mf 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
COSC$235,$Fall$2008$ $ David$A.$Sykes$
Name:$_____________________________$ $ Pledged:$_____________________________$
Quiz%2%
Se pte mber (12,(2008(
1. Number$the$activities$below$to$show$he$order$they$occur$in$software$development.$
____$design$ ____$implementation$ ____analysis$ ____$maintenance$ ____$test$and$debug$
2. Circle$the$invalid$identifiers$in$the$list$below.$
Coca‐Cola$ sprite$ Dr.Pepper$ orangeCrush$ Fanta$ 7up$ H2O$ _oHIo_$
3. Some$identifiers$are$part$of$Python$and$have$specific$uses$so$they$can’t$be$used$for$variable$names,$function$
names,$and$the$like.$These$are$called$________________$___________.$
4. Show$the$output$of$the$program$[look$carefully].$
for k in range(3):
print "going,",
print "gone!"
5. Show$the$output$of$the$following$code$segment.$
a = 10
b = 5
t = a * 3
a = b * 2
b = t
print a, b
6. The$equal$sign$used$in$the$first$Python$statement$in$Question$5$is$called$the$_____________________$
operator.$Semantics:$The$expression$on$the$right$side$of$=$is$evaluated$to$produce$a$value$that$is$then$
associated$with$the$variable$named$on$the$left$side.$
$
7. A$loop$that$will$execute$a$definite$number$of$times$is$called$a$____________________$loop.$
8. Show$the$output$of$the$program.$
for k in [ 1, 2, 4 ]:
print k,
print
print "Done!"
9. The$expression$range(4)$is$equivalent$to$writing$________________________________________.$
$
10. Statements,$such$as$for,$are$called$control'structures.$In$ONE$sentence,$explain$the$concept$flow'of'control.$
$
$
$

Partial preview of the text

Download Quiz 2 for COSC 235, Fall 2008 by David A. Sykes - Prof. David A. Sykes and more Quizzes Computer Science in PDF only on Docsity!

COSC 235, Fall 2008 David A. Sykes Name: _____________________________ Pledged: _____________________________

Quiz 2

September 12 , 2008

  1. Number the activities below to show he order they occur in software development. ____ design ____ implementation ____analysis ____ maintenance ____ test and debug
  2. Circle the invalid identifiers in the list below. Coca‐Cola sprite Dr.Pepper orangeCrush Fanta 7up H2O oHIo
  3. Some identifiers are part of Python and have specific uses so they can’t be used for variable names, function names, and the like. These are called ________________ ___________.
  4. Show the output of the program [look carefully]. for k in range(3): print "going,", print "gone!"
  5. Show the output of the following code segment. a = 10 b = 5 t = a * 3 a = b * 2 b = t print a, b
  6. The equal sign used in the first Python statement in Question 5 is called the _____________________ operator. Semantics: The expression on the right side of = is evaluated to produce a value that is then associated with the variable named on the left side.
  7. A loop that will execute a definite number of times is called a ____________________ loop.
  8. Show the output of the program. for k in [ 1, 2, 4 ]: print k, print print "Done!"
  9. The expression range(4) is equivalent to writing ________________________________________.
  10. Statements, such as for, are called control structures. In ONE sentence, explain the concept flow of control.