Spring Semester 08, Dr. Punch. Exam #1 (2/12), form 1 B

Similar documents
Spring Semester 08, Dr. Punch. Exam #1 (2/12), form 1 A

Spring Semester 13, Dr. Punch. Exam #1 (2/14), form 1 A

Fall 08, Sherri Goings, Exam #1 (10/2), form 1 B

Spring Semester, Dr. Punch. Exam #2 (03/28), form 2 C

Spring Semester 09 Exam #1 Dr. Dillon. (02/19)

Spring Semester 16, Dr. Punch. Exam #1 (2/18), form 1 A

Spring Semester 10 Exam #1 Dr. Dillon. (02/18)

Spring Semester 11 Exam #1 Dr. Dillon. (02/15)

First name (printed): a. DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Spring Semester 09 Exam #2 Dr. Dillon. (04/02)

Fall Semester, Dr. Punch. Exam #2 (11/07), form 2 A

Exam 2, Form A CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 2, Form B CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam #1, Form 1 A CSE 231 Spring 2015 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam #3, Form 3 A CSE 231 Fall 2015 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Final Exam, Form 3 A CSE 231 Spring 2015 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 1, Form A CSE 231 Fall 2012 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

First name (printed): a. DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 3, Form A CSE 231 Spring 2014 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Exam 2, Form A CSE 231 Spring 2013 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

CS 2316 Exam 1 Spring 2013

Test #2 October 8, 2015

CS 1301 Exam 1 Fall 2010

Midterm Examination (MTA)

CS 1301 CS1 with Robots Summer 2007 Exam 1

Conditional Expressions and Decision Statements

The American University in Cairo Computer Science & Engineering Department CSCE Dr. KHALIL Exam II Spring 2010

15110 PRINCIPLES OF COMPUTING SAMPLE EXAM 2

CS 2316 Exam 1 Spring 2014

CS 1301 Exam 1 Fall 2010

CS 111X - Spring Final Exam - KEY

CSEN202: Introduction to Computer Science Spring Semester 2017 Midterm Exam

15-110: Principles of Computing, Spring 2018

CIS 110 Introduction to Computer Programming Spring 2016 Midterm

a. a * c - 10 = b. a % b + (a * d) + 7 =

CS 1301 Exam 1 Fall 2014

CS 1301 Exam 1 Fall 2014

CS110 Introduction to Computing Fall 2006 Midterm Exam

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

CS Name : Grading TA:

Lecture Programming in C++ PART 1. By Assistant Professor Dr. Ali Kattan

CS 1301 Exam 1 Spring 2011

Write code that simulates one roll of a 6-sided die and prints out the

Exam 2. Programming I (CPCS 202) Instructor: M. G. Abbas Malik. Total Marks: 40 Obtained Marks:

CIS 110 Introduction to Computer Programming Summer 2018 Midterm. Recitation ROOM :

Numerical Methods. Centre for Mathematical Sciences Lund University. Spring 2015

Conditionals and Recursion. Python Part 4

Part III Appendices 165

AP Computer Science Principles Exam Reference Sheet

Structure and Interpretation of Computer Programs

Exam 1 Format, Concepts, What you should be able to do, and Sample Problems

Q1 Q2 Q3 Q4 Q5 Total 1 * 7 1 * 5 20 * * Final marks Marks First Question

AP Computer Science Principles Programming Question Tips. 1: Which algorithm/code segment achieves some result?

Final Exam Version A

EXAMINATION FOR THE BSC (HONS) INFORMATION SYSTEMS; BSC (HONS) INFORMATION TECHNOLOGY & BSC (HONS) COMPUTER SCIENCE; YEAR 1

Assignment 6. Methods Homework Spring 2017 P Question 1 all

Lab1. Introduction to Python. Lab 4: Selection Statement. Eng. Mai Z. Alyazji

The Practice of Computing Using PYTHON. Chapter 2. Control. Copyright 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley

Total 100. The American University in Cairo Computer Science & Engineering Department CSCE 106. Dr. Khalil Exam II Fall 2011

Computer Programming

THE UNIVERSITY OF BRITISH COLUMBIA CPSC 110: MIDTERM 1 Part B May 26, Important notes about this examination

Midterm Exam 2B Answer key

Practice Midterm 1. Problem Points Score TOTAL 50

SCHEME 10 COMPUTER SCIENCE 61A. July 26, Warm Up: Conditional Expressions. 1. What does Scheme print? scm> (if (or #t (/ 1 0)) 1 (/ 1 0))

CS 111X - Fall Test 1

CIS 110 Introduction to Computer Programming Summer 2014 Midterm. Name:

THE AUSTRALIAN NATIONAL UNIVERSITY Mid Semester Examination September COMP1730 / COMP6730 Programming for Scientists

15-110: Principles of Computing, Spring 2018

Structure and Interpretation of Computer Programs

CS 1301 Exam 3 Spring 2012

CS 111X - Fall Test 1 - KEY KEY KEY KEY KEY KEY KEY

More Programming Constructs -- Introduction

CIS192 Python Programming. Robert Rand. August 27, 2015

ENGR 102 Engineering Lab I - Computation

CIS 110 Introduction to Computer Programming Summer 2018 Final. Recitation # (e.g., 201):

CS 1301 Exam 1 Spring 2014

Lecture 11: while loops CS1068+ Introductory Programming in Python. for loop revisited. while loop. Summary. Dr Kieran T. Herley

Part 1 (80 points) Multiple Choice Questions (20 questions * 4 points per question = 80 points)

Structure and Interpretation of Computer Programs

CPSC 121 Some Sample Questions for the Final Exam Tuesday, April 15, 2014, 8:30AM

4. Write a sum-of-products representation of the following circuit. Y = (A + B + C) (A + B + C)

UTORid: Lecture Section: (circle one): L0101 (MWF10) L0201 (MWF11) Instructor: Jacqueline Smith Jen Campbell

CS 1803 Fall 2010 Exam 1

Chapter 5. Repetition. Contents. Introduction. Three Types of Program Control. Two Types of Repetition. Three Syntax Structures for Looping in C++

CIS 110 Introduction to Computer Programming 8 October 2013 Midterm

University of Maryland College Park Dept of Computer Science CMSC106 Fall 2013 Midterm I Key

Python for Non-programmers

Computer Programming : C++

Python for Informatics

CIS Introduction to Computer Programming Spring Exam 1

Math 1MP3, midterm test February 2017

Programming Project #1

Programming Fundamentals and Python

Final Exam May 8, 2018

Exam 1 Practice CSE 232 Summer 2018 (1) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN.

Programming Fundamentals - A Modular Structured Approach using C++ By: Kenneth Leroy Busbee

Computing Science 114 Solutions to Midterm Examination Tuesday October 19, In Questions 1 20, Circle EXACTLY ONE choice as the best answer

Senthil Kumaran S

CS 1301 Exam 1 Spring 2014

Control, Quick Overview. Selection. Selection 7/6/2017. Chapter 2. Control

Transcription:

Spring Semester 08, Dr. Punch. Exam #1 (2/12), form 1 B Last name (printed): First name (printed): Directions: a) DO NOT OPEN YOUR EXAM BOOKLET UNTIL YOU HAVE BEEN TOLD TO BEGIN. b) You have 80 minutes to complete the exam (12:40-2:00 pm) c) This exam booklet contains 26 multiple choice questions, each weighted equally (5 points) and one 20 point write some code question. Nine pages total d) You may use one 8.5" x 11" note sheet during the exam. No other reference materials or calculating devices may be used during the examination. e) Questions will not be interpreted during the examination. f) You should choose the single best alternative for each question, even if you believe that a question is ambiguous or contains a typographic error. g) Please fill in the requested information at the top of this exam booklet. h) Use a #2 pencil to encode any information on the OMR form. i) Please encode the following on the OMR form:! Last name and first initial! MSU PID! Exam form (see the title of this page) j) Please sign the OMR form. k) Only answers recorded on your OMR form will be counted for credit. l) Completely erase any responses on the OMR form that you wish to delete. m) You must turn in this exam booklet and the OMR form when you have completed the exam. When leaving, please be courteous to those still taking the exam. Good luck. Timing tip. A rate of 2.5 minute per multiple choice problem leaves 15 minutes to write the 20 point program at the end Key 1 2 3 4 5 6 7 8 9 10 A A C E D C B C B E 11 12 13 14 15 16 17 18 19 20 D C A B E A D C E B 21 22 23 24 25 26 E D B C A B

Figure 1 1) Given the input abc what output is produced by Line1 in Figure 1? a) abc b) bca c) baa d) bcc 2) Given the input aabb what output is produced by Line1 in Figure 1? a) baa b) aabb c) bba d) abb 3) Given the input bccc what output is produced by Line1 in Figure 1? a) bcc b) bccc c) ccc d) bbc 4) Given the input ccbb what output is produced by Line1 in Figure 1? a) bcc b) bccc c) ccc d) bbc

5) Which of the following is a true statement(s) about Python slicing? a) a range, indicated with a :, is a half-open range b) a negative number starts counting from the end of the string starting with -1 c) the first element in a string begins at index 0 d) All of the above 6) As an approximation, every 3 powers of 10 are about equal to what? a) 3 powers of 2 (10 3 ~ 2 3 ) b) 8 powers of 2 (10 3 ~ 2 8 ) c) 10 powers of 2 (10 3 ~ 2 10 ) d) 16 powers of 2 (10 3 ~ 2 16 ) 7) What is the index of the last element of every string? a) len(s) b) len(s) -1 c) len(s-1) d) -2 8) Python is an interpreted language. What does the term interpreted mean? a) Python understands the language and does what is required b) Python converts a program into machine language so it can be run c) Python runs each line of the program, one line at a time d) Python requires a special kind of CPU to be able to operate. 9) What is a namespace a) A list of Python names b) A list of Python names and the values they are associated with. c) The list of allowable names that can be used in Python d) All of the above 10) Given the python statement myfloat = 3.14 which of the following statements are true a) myfloat can only hold floating point values b) myfloat can only hold integer values c) myfloat can only hold any numeric value d) myfloat cannot hold Boolean values 11) Which of the following describes the advantages of modules? a) share knowledge with others about how to solve a particular problem

b) saving effort by allowing reuse of code by others c) verification of the code by use in many other systems d) All of the above Figure 2 12) Given user input of 0, what value does the program in Figure 2 print? a) A b) B c) C d) D. 13) Given user input of 2, what value does the program in Figure 2 print? a) A b) B c) C d) D. 14) Given user input of 3, what value does the program in Figure 2 print? a) A b) B c) C d) D. 15) What input causes the else clause of Line 2 to be executed in Figure 2 a) odd integers b) even integers c) integers evenly divisible by three d) negative integers. 16) What is the purpose of the : (colon) at the end of Line 1 of Figure 2 a) beginning of a compound statement (a suite) b) end of a compound statement (a suite) c) indication of a change of control in the program (a modifier) d) only there to make the program more readable (a kind of comment)

. Figure 3 17) Given the input abc123 what output is produced by Line 2 of Figure 3? a) [ a, b, c, 1, 2, 3 ] b) [ 1, 2, 3, a, b, c ] c) [ 0, 1, 2, a, b, c ] d) [ 0, 1, 2, b, c, d ] 18) Given the input 3.14159 what output is produced by Line 3 of Figure 3? a) 4 b) 5 c) 6 d) 7 19) Given the input $1000 what output is produced by Line 4 of Figure 3? a) 1 b) 2 c) 3 d) 4 20) If Line 1 were removed from Figure 3, what effect would it have? a) No effect

b) infinite loop c) depends on the input string d) error, index beyond the length of the string Figure 4 21) What output is produced by Line 2 of Figure 4 on the input 1? a) 1 b) 3 c) 9 d) 16 22) What output is produced by Line 2 of Figure 4 on the input 3? a) 1 b) 3 c) 9 d) 16 23) What output is produced by Line 2 of Figure 4 on the input 5? a) 5 b) 144 c) 25 d) 256 24) For the program in Figure 4, what effect would there be in changing Line 1 from count < 5 to count <= 5? a) error, division by 0 b) no change, works exactly as before c) would go through the loop one more time

d) error, infinite loop 25) What type does the variable num contain in Figure 4? a) integer b) floating point value c) string d) Boolean 26) Which of the following are true statements regarding for loops and while loops? a) only a for loop can iterate through a sequence b) a while loop is the more general looping statement of the two c) the for loop requires a boolean in its statement header d) All of the above

27) Write a small program question 20pts. Please, write on scrap paper first, then copy your answer to the next page Requirements Write a program that: prompts for two, three digit integers (no error checking required) combine those two integers into one larger string as follows: o the first integer s digits make the first, third and fifth character of the o string the second integer s digits make the second, fourth and sixth character of the string append the character : to the end of the string print out as indicated below Example given the inputs 123 456 o prints 142536: given the inputs 111 222 o prints 121212:

Name: Section: