0% found this document useful (0 votes)
117 views

The Joy of Computing Using Python: Assignment 1

This document contains 10 multiple choice questions about computer programming concepts like control structures, variables, and libraries. It provides the questions, multiple choice answers, and indicates the correct answer for each question. The questions cover topics like the definition of a computer program, using commands to control a sprite's movement and actions, writing code to calculate a factorial, and predicting the output of code snippets.

Uploaded by

Farheen Bano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
117 views

The Joy of Computing Using Python: Assignment 1

This document contains 10 multiple choice questions about computer programming concepts like control structures, variables, and libraries. It provides the questions, multiple choice answers, and indicates the correct answer for each question. The questions cover topics like the definition of a computer program, using commands to control a sprite's movement and actions, writing code to calculate a factorial, and predicting the output of code snippets.

Uploaded by

Farheen Bano
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

The Joy of Computing using Python

Assignment 1

1. Which of the following is true about a computer program?

(a) It is a sequence of instructions


(b) Instructions that are written in simple english
(c) There is only one universal programming language
(d) It is meant for only software developers

CORRECT ANSWER: (a)


2. Assume you are given two images, each displaying two basic positions of situps. Identify the set of commands
to perform an exercise with both images.
(a) Turn clockwise 90 degree/Turn clockwise -90 degrees
(b) Move 10 steps/Move -10 steps
(c) Hide/Show
(d) point in direction 90/point in direction -90
CORRECT ANSWER: (c)

3. Choose the best command to be used at the start of your code, to locate the sprite at an initial position every
time you play the animation.
(a) change x to val
(b) set x to val / set y to val
(c) point in direction 90
(d) point towards mouse pointer
CORRECT ANSWER: (b)
4. Assume the sprite is a ball and predict the output of the following control structure.

(a) The ball glides to a random position in 1 second


(b) The ball glides to 10 random positions taking 1 second to reach each position
(c) The ball glides to a random position and waits there for 10 seconds
(d) The ball glides to 10 random positions within 1 second

CORRECT ANSWER: (b)

1
5. Pick the snippet that helps the sprite to find the factorial of 5 as output.
Given:
Factorial(n)=1 x 2 x 3 x .. x (n-1) x n

(a)

(b)

(c)

2
(d)

CORRECT ANSWER: (a)


6. Predict the sequence of numbers that the sprite recites:

(a) 1, 2, 3, . . , 19
(b) 1, 3, 5, . . , 19
(c) 3, 5, 7, . . , 19
(d) 1, 2, 3, . . , 20

CORRECT ANSWER: (b)

3
7. Consider a road inclined at an angle of 30◦ and we have a car sprite to be driven over this road. Pick the code
that helps to perform the same. Hint: The initial direction of the sprite is 90◦ .

(a)

(b)

4
(c)

(d)

CORRECT ANSWER: (d)


8. Identify the command to communicate across multiple sprites.
(a) say message
(b) play sound
(c) Broadcast message
(d) touching color
CORRECT ANSWER: (c)

5
9. Pick out the scratch library that provides the functionality to switch backdrop?
(a) Motion
(b) Control
(c) Looks
(d) Sensing
CORRECT ANSWER: (c)
10. Imagine a Magic wand sprite and predict the output for the following set of instructions.

(a) The Magic wand flies to a random position takes 1 sec pause and then reaches another random position.
(b) The Magic wand flies to a random position in 1 sec and after a 0.25 sec pause, it repeats the same until
it is stopped.
(c) The Magic wand reaches all edges of the screen in a uniform pattern
(d) The Magic wand flies between the top and bottom edges repeatedly.

CORRECT ANSWER: (b)

You might also like