NYU CSCI-UA 0002 - Midterm Exam with answers (5 pages)

Previewing pages 1, 2 of 5 page document View the full content.
View Full Document

Midterm Exam with answers



Previewing pages 1, 2 of actual document.

View the full content.
View Full Document
View Full Document

Midterm Exam with answers

31 views

Problems/Exams


Pages:
5
School:
New York University
Course:
Csci-Ua 0002 - Introduction to Computers and Programming

Unformatted text preview:

Midterm No 1 for V22 0002 005 Wednesday October 6 2010 There are three sections Each section is worth 35 points The maximum score on the test is 105 Please remember to print your name clearly on every page of this test as well as on the accompanying blue booklet Please feel free to write answers both on this page and the test booklet However please make it clear in each case so I know where to find your answer Section 1 For each statement indicate a what will be printed to the screen and b what is the value or output of the expression Write NOTHING in all capital letters to indicate that there is nothing printed or that the expression has no value Note that the equals sign which assigns a value to a variable is assumed to have NOTHING for output as well If the statement should produce an error a write ERROR in the last column and b put ERROR in the Print Out column unless you expect something to print out before the error message See the examples for clarification Question Sample 1 Sample 2 Sample 3 Sample 4 Sample 5 1 Expression print 123 x 5 1 1 1 Fred print 5 duck 5 2 Print Out 123 NOTHING NOTHING ERROR 5 NOTHING Value NOTHING NOTHING 2 ERROR ERROR 52 2 5 2 NOTHING 55 3 5 2 NOTHING 25 4 print A single quote looks like this A single quote looks like this NOTHING 5 print book 3 ERROR ERROR 6 first number 37 NOTHING NOTHING 7 str int 57 ducks NOTHING 57 ducks 8 chocolate 5 ERROR ERROR 9 hellooooo ERROR ERROR 10 int 57 57 ERROR ERROR Section 2 Below will be a number of function definitions containing errors On the appropriate line numbers in the table below the function please list the errors if any along with possible corrections In each case a minimum number of errors is listed You do not need to find more errors than that number For example if the description says to find three errors you only need to find three even if there are actually four or five errors Sample 6 The function minus takes two numbers as input and subtracts the second from the first There is



View Full Document

Access the best Study Guides, Lecture Notes and Practice Exams

Loading Unlocking...
Login

Join to view Midterm Exam with answers 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 Midterm Exam with answers 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?