DOC PREVIEW
USF CS 110 - CS 110 Midterm 1 Review

This preview shows page 1 out of 4 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 4 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

Midterm 1 Review Study Guidelines Midterm is Wednesday, Feb. 27ListsFunctionsBits and BytesTracing a ProgramConditionsCS 110: Introduction to Computer Science Spring 2008Midterm 1 ReviewStudy GuidelinesMidterm is Wednesday, Feb. 271. Study the programs you have written and/or the solutions that have been handed out. Could you write them from scratch?2. Study the worksheets we have completed in class. Can you answer the questions?3. Study with another student or students. Figuring out what is important to know for a test is difficult, and the help of classmates is vital.4. Talk about the terminology and concepts. Write out answers. Write out code on paper. Have your study partners critique your answers and code.5. Come in to your teacher's office and ask questions. Your teacher knows what is on the test, knows the answers, and is pretty good at teaching you stuff. Sometimes 1/2 hour with an instructor can be worth hours of studying on your own. Take advantage of your resources!6. Read your on-line text book through chapter 9. There will be upto ten percent of the test on topics in these chapters (and not necessarily discussed in class)ListsHow is an empty list created?How do you add elements to an empty list?What's wrong with the following code: list=[] list[0]=0CS 110: Introduction to Computer Science Spring 2008What happens with the following code: list1=list2How do you copy a list? What's the result of the following code: list1=[1,2,3] list2=list1 list2[1]=9 print list1 print list2Write a function that accepts a list of integers as a parameter andreturns the total of all elements.Write a function that initializes a list so that each element is equalto its index. The function should allow the caller to specify how big the resulting list should be. Write this function in two ways: with a return value and without.Write a function that doubles the values in a list.How do you represent a matrix in Python code? What kind of loopis generally associated with matrix manipulation code? Write a function that totals the elements of a matrix.FunctionsWhat is a function signature?What is a local variable?What is a global variable?What is a formal parameter? What is an actual parameter?What is Pass-by-Value?What is Pass-by-Reference?CS 110: Introduction to Computer Science Spring 2008In Python, which type of parameters are sent "by-value"? Which are sent "by reference"?What is the value of x and y after the following code is executed: def f(x): x=x+1 y=5 x=8 f(y) f(x)What are the different ways a function can affect things?Why is it considered poor programming practice to refer directly to global variables in a function? What is the better alternative to structure a program?Bits and BytesConsider the following string: s = 'cat' What bits are actually stored in the memory cell for the string s?Consider the following integer: x = 45. What bits are actually stored at the memory cell for x?What does the term 'byte addressable' mean?What is the largest integer than can be stored in n bits?What is machine language? Assembly language? What does a compiler do?Tracing a ProgramWhere does execution of a program begin?When do you create a memory box?When a function is called, what happens?CS 110: Introduction to Computer Science Spring 2008When a function ends, what happens?Can you trace your mastermind program?Conditionsif, elif, else==, !=, <,>,<=,>=and, or,


View Full Document

USF CS 110 - CS 110 Midterm 1 Review

Download CS 110 Midterm 1 Review
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CS 110 Midterm 1 Review and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CS 110 Midterm 1 Review 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?