StudyGuideForExam2-2023F

pdf

School

Rutgers University *

*We aren’t endorsed by this school

Course

110

Subject

Computer Science

Date

Jan 9, 2024

Type

pdf

Pages

14

Uploaded by GeneralTeamDeer34

Report
1 Exam 2 Format and Administration Your EXAM 2 will be given in person on Wednesday, November 15 th , 2023 DURING YOUR REGULAR CLASS MEETING TIME. The exam will cover material from WEEKS 6, 7, 8, and 9 (all of Scratch programming UP TO but NOT INCLUDING Scratch lists) and quizzes from weeks 7, 8, 9, and 10. Exam Locations PLEASE NOTE YOUR ASSIGNED LOCATION!!!!! 2:15PM 3:15PM: Sections 1, 2, 3: FBO-EHA ( Prof. Belowich, HASNAIN) Sections 4, 5: EN-B120 (ANIRUDH, SAHANA)- 4:05PM 5:05PM Sections 10, 11: PH 111- (Prof. Belowich, SHUSHANG ) Sections 12, 13, 14 : EN - B120 ( SHREYA, VANSHIKA) Format The exam is worth 60 points. Bring a writing utensil (pencil or pen). We do not supply these. The exam will include: 30 points: o Multiple Choice o Multiple Answer 30 points: o Fill-in the blanks o Write program code o Give the output of a program segments o Find/fix errors We will provide the SCRATCH REFERENCE SHEET for your use during all parts of the exam. It will be printed in black-and-white (not color). You should practice using this as you prepare for the exam. It can be found in Exam2 Information folder in Canvas. Other requirements You are on your honor to complete the exam. If you know that one of your classmates has violated the AI policies, it is your responsibility to report the incident to the course coordinator ( fran.trees@cs.rutgers.edu ) or to your instructor, giving all of the details of the situation. Your report of the incident will be considered confidential. The instructor will take the appropriate action and the incident will be investigated.
2 Calculators are not to be utilized during the exam. Cell phones must be TURNED OFF and out of site. If the problem indicates “SHOW ALL WORK” and you do not show your work, you will not receive credit for the problem. For multiple choice questions, you are required to CIRCLE the correct answer. WRITING ANSWERS IN THE MARGIN will result in NO CREDIT for those problems. Remember to bring your photo/signature ID and have it ready when you return your completed exam. You cannot leave the exam room until you are finished with the exam. You cannot start the exam late if someone has already finished and turned in the exam. Preparation for Exam 2 Review the following resources posted in Canvas: Developing Solutions To Problems for examples of IPO-S to Pseudocode to Flowchart to program. Algorithms Study Guide and Algorithm Resources to help you with the definitions of the terms. _Problems to Solve and Worksheet_Variables to help you write code using decision statements and variables and simple loops. Some problems-Make Your Own Blocks and Algorithms Study Guide2 and Making Blocks to review loops and blocks: Learning Objectives: WEEK 6 , WEEK 7, WEEK 8 , AND WEEK 9 Review your assignments. Be sure you understand the solutions to the assignments. If you have trouble with Scratch, visit Lab Support hours. In addition to reviewing your assignments, the study guide, and your lecture notes, the problems below may help prepare you for the exam. 1. What does the sprite say? a.
3 b. c. d. e. f. Assume needed input from: 4,6,5,1,2,10,12
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
4 g. Assume needed input from: 4,6,5,1,2,10,12 h. Assume needed input from: 4,6,5,1,-1, 2,10,12 i.
5 j. k. 2. Give both the x- and y-coordinates of the points X, A, B, C, and D on the stage below. You can approximate. X_______ A_______ B______ C______ C______ 3. In the box below, sketch the path followed by the sprite when the following code is executed. Put an S for start, and F for finish and arrows indicating the direction of movement. A B X C D
4. In the box below, sketch the path followed by the sprite when the following code is executed. Put an S for start, and F for finish and arrows indicating the direction of movement. a) Assume input 30, -40 b) Assume input of -40, 50 c) Assume input of -40, -30 5. The following scenario has two sprites. The code for each sprite is given. Describe what happens when the space key is pressed. Sprite 1 Code: Sprite2 Code:
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
7 6. Consider the following code segment. Assume the program input is 2, 3, 4 in that order. What will the cat say when the green flag is pressed? 7. Consider the following code segment. Assume the program input is 2, 3 in that order. What will the cat say when the green flag is pressed?
8 8. Consider the following code segment. Assume the program input is 2, 7 in that order. What will the cat say when the green flag is pressed?
9 9. Consider the following code segment. Assume the program input is 12, 3 in that order. What will the cat say when the green flag is pressed? 10. Consider the following code segment. Assume the program input is 15, 1 in that order. What will the cat say when the green flag is pressed?
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
10 11. Consider the following code segment. What will the sprite say when the green flag is pressed?
11 12. Sketch the picture the sprite draws when the green flag is clicked.
12 13. Consider the following segment code. PROGRAMMING: You should write the following programs on paper . You are not using your computer during the exam unless we are in a remote environment, so it is important that you are able to write code on paper. Use the Scratch reference guide for help. The exam is printed in black and white so it would benefit you if you were to print the reference guide in black and white and refer to it when you are answering the following questions. 1. There are 5 students in a class. Each student has 3 test scores. All test scores will be input by the teacher. Write a program that will ask the teacher for the test scores for each student and after the test scores for an individual student are entered, the average for that student is output. At the end, 5 averages have been output. 2. Almost the same problem as above: There are 5 students in a class. Each student has a number of test scores but the students do not necessarily have the same number of test scores. All test scores will be input by the teacher. Write a program that will ask the teacher for the test scores for each student and after the test scores for an individual student are entered, the average for that student is output. At the end, 5 averages have been output. a. What will the sprite say when this code is executed? 9In the table below, give a pair of numbers (for num1 and num2) that will result with the sprite saying what is in the first column. Sprite says… num1 num2 These two numbers are related This is a special number Better one than none Both do not work
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
13 3. Yet another version: There are a number of students in a class but the exact number of students is not known. Each student has a number of test scores but the students do not necessarily have the same number of test scores. All test scores will be input by the teacher. Write a program that will ask the teacher for the test scores for each student and after the test scores for an individual student are entered, the average for that student is output. At the end, the average for each student has been output. 4. Develop the IPO-S, flowchart, and program for the following problem: You are to determine and display the largest of two numbers input by the user. 5. Develop a flowchart and write a Scratch program segment to exchange the values of two variables num1 and num2. 6. Develop the IPO-S, flowchart, and program for the following problem: You are to determine and display the largest of three numbers input by the user. 7. A program accepts three pieces of information about a car: Tank size (in gallons), miles per gallon the car gets, and total miles of particular trip. Write a program that will output the number of gallons of gas that will be needed to make the trip and output whether or not the car can make the trip on one tank of gas. 8. Create the IPO and flowchart for #7. 9. Write the code that would define a block (Make your own block) that accepts two number inputs and has the sprite say if the numbers are both even, both odd, or one even and one odd. 10. Write the code that would define a block (Make your own block) that accepts two number inputs and has the sprite say "TWO THE SAME" if both are positive or both are negative and says "TWO DIFFERENT" if one is positive and one is negative. 11. The goal of a Scratch program is to have two sprites face each other have the sprites move towards each other until they meet exactly half way. To do this, make 4 variables to store the x- and y- positions of the sprites. Then you need only find the "midpoint" of the imaginary line connecting the two sprites. To do this, add the x's and divide by 2, add the y's and divide by 2. That's the midpoint and that should be the end position of both sprites. Try this on the computer first!
14 12. Write SCRATCH code that will result in the following picture: