Change Contents of the Bubble
Welcome to CS1315. Click on the python to add comments.

Looking for the book? They have it at the Engineer's Bookstore at 748 Marietta St NW. Here is there website: http://www.engrbookstore.com/ - Monica

Hotspots: Slides and CodeTA CornerComments?AnnouncementsFAQStatic Webspace
View this PageEdit this PageUploads to this PageHistory of this PageHomeRecent ChangesSearchHelp Guide

Pre Quiz 3 Question Page Fall 2006

Ask Questions Here. TAs will be answering questions over the break here.


when is it
November 28th. -Albert d'Heurle
What dates and/or chapters is the quiz over?
Everything since the last quiz. Check out the Syllabus for the lecture slides for all the topics covered in class. Toni Walden

Everything since the last quiz or the last midterm? We had a Midterm before the last quiz.
Since the last midterm might be more accurate. All you actually need to do is work out the prequiz and look at the corresponding slides for extra info. - Bobby Mathew

I am at a complete loss on how the final question on the prequiz concerning tracing works.
Tracing can be very difficult. I recommend writing the outcome of each step / line on the side of the function. If you still are having difficulty I would track down a TA in his or her office hours. -Albert d'Heurle

What do we need to know about FTP? I know that it is a mail protocol, but that is all I know.
I don't think I would define FTP as a mail protocol. I think it would help if you thought about what the acronym FTP stands for and how you would use it. Maybe even more helpful - what did you use an FTP for? (I promise you've used one in this class) Toni Walden

On number 3,
ii)In the line “ln.capitalize ()” what does ln represent?
iii)In the line “ln.capitalize ()” what does capitalize represent?
Do you have a hunch? Toni Walden

On 2-a, it says that a movie needs to be 16 frames per second, but can't it be higher? I thought 16 was the lowest, and 30 was the highest.
You're right, it can be at a higher rate. For this class, we're going to consider 16 as optimal. You need at least 16 to get a sense of motion. That's all you need to write for that question. However, don't believe that 30 is the highest. Example: The PS3's Bluray player plays movies at 60fps. - Bobby Mathew


for number 3 ii and iii- i dont get what its asking for either- the object and method??
Yes, what kind of thing is referred to by the name: object, method, function, module, variable, etc? Colin Potts

is 4-c polymorphic?
No. A single command is being executed several times here. Polymorphism is when a several objects each have a method with the same name (usually because they have different ways to do the same thing.) Colin Potts

does the code in number three actually work, or is that that point? I checked, and it returns "you are trying to access a part of an object that does not exist". I don't understand.
There is a spelling error in the code. Thank you for checking. Now, what should it say? This is good debugging practice! Colin Potts

how do you get the movie box in the middle?

In question number three, the way it is written (with the spelling correction) it just returns: this is a line of text. Shouldnt it say print ln.capitialize() instead bc then it will capitalze the T in this?
I think someone is on a very good track.... :) Toni Walden


Is this corret for 1b?

1b) Using some or all of the above terms explain how when you type an address in a browser such as Firefox a webpage is displayed

URLs tell the server what resource you are looking for. Then the HTML or HTTP code formats the information that you see on the screen.
A few things to note: Neither HTML nor HTTP are code. What are they? You almost have it with URL...though think about what the URL tells the server. Is it actually telling the server what to look for or is it telling the server how to look for it, or maybe its telling the server where to find it? Toni Walden


Why can't you have movies have a higher frame per second?



What is the difference between the server and the client?

This is what I found
v) Client- a browser that accesses a server
vi) Server- a computer that is running a piece of software, the place where the resource can be found


for 2 B: Does this look right?
def practice():
for frame in range(50):
canvas = makeEmptyPicture(400,400)
addRectFilled(canvas, frame times 5, 180, frame times 5 + 50, 220, red)
Review the inputs for addRectFilled.....make sure everything you are changing makes sense Toni Walden

Is the language used to interface with databases, ....SQL (standard query language)?
I would say that is a very common practice ;p Toni Walden


for 2 B I got:
def practice():
canvas=makeEmptyPicture(400,400)
addRectFilled(canvas, 1, 1, 400, 400 white)
for frame in range (0,50):
addRectFilled(canvas, frame5, 200, 50, 50, red)



Wait, from my post above I meant to say frame times 5 in the last line. Also there should be a comma after 400 and before white on line 4 so it should read 400,white .

for 2B I have- I am not sure if it is right
def practice():
for frame in range(1,51):
canvas = makeEmptyPicture(400,400)
addRectFilled(canvas, (50-(frame-50))+5, (50-(frame-50), 50, 50,red)


on 2B I got
def practice():
for frame in range(1,51):
canvas = makeEmptyPicture(400,400)
addRectFilled(canvas, (50-(frame10))+5, 100, 50, 50,red)
But I don't know if the addRectFilled part is correct
Try it in JES.

in 3:does ln represent the object and does capitalize represent the method?
yes. -Albert d'Heurle

Is 333 right as the print out for 4B?
You are missing some stuff -Albert d'Heurle

For 4C is the answer Because s itself is 3 and the answer to s10 + num is 33 ?
Think for loop -Albert d'Heurle

the answer for 4c comes out as 3, 33, 333 because the function takes in the original number then prints back the number as it is altered by the function (33) and that number in turn goes through the funtion again and becomes 333 because of the line " s = s10 + num". So if the number is 4 it would be 4, 44 444, 4444.


def fun(num):
  for i in range (num):
# the range of 3 is [0,1,2]
    s=num
# s is 3
    for z in range(i):
# "z in range i" --> 0 is [], 1 is [0], 2 is [0,1]
      s=s*10+num
    print s

This is as far as my understanding of 4B goes(with regard to 3 as the input); I understand the 33 and 333, but I can't figure out how the 3 fits in. It seems like it should be 33, 333, 3333 instead (even though I know that's wrong).
What is the range(0). If you have a range of zero the for loop is skipped over. Does that help? -Albert d'Heurle

for 2b is this right?
def movingRectangle(directory):
for frame in range(1, 51): #50 frames
canvas = makeEmptyPicture(400,400)
addRectFilled(canvas, (50-(10-frame))+5, 200, 50, 50,red)
framenum=str(frame)
if frame 10:
writePictureTo(canvas,directory+"//frame0"+framenum+".jpg")
if frame >= 10:
writePictureTo(canvas,directory+"//frame"+framenum+".jpg")
The easiest way to see if this function works is to run it in JES...


What are all the lecture notes included on the quiz?
Everything since the last midterm is fair game: generating HTML, movies, simple objects, networking, mediashifts and databases. However, the pre-quiz is a very good guide for what is on the quiz. We won't try to trick you with any wildly different topics. Colin Potts


for 2b
def Practice():
x=1
for frame in range(1,51):#for 50 frames
canvas=makeEmptyPicture(400,400)#canvas size
addRectFilled(canvas,x,175,50,50,red)#x because it is the variable that will be changing, 175 is the upper left y value of the 50,50 box that is located in the center of the canvas
x=x+5 #moves the square accross the canvas 5 pixels at a time


Link to this Page