Current Recruitment 2023 | mahajobs | Vartaman Bharti | नोकरी

Thursday, July 9, 2020

code yourself an introduction to programming quiz answers

code yourself an introduction to programming quiz answers


Syllabus

Your First Computer Program
-In this unit you’ll create your very first computer program! You’ll be introduced to basic programming concepts and you’ll familiarise yourself with Scratch.

Code Gone Loopy!
-In this unit you’ll keep working with control structures, you’ll find out how to use events in your programs and how to incorporate visual and sound effects in Scratch. You’ll also start thinking about the requirements and the design of your program.


Remixing Games
-In this unit you’ll have a go at modifying and extending existing games to create new versions. You’ll also learn about software engineering practices for testing and documenting your programs.

Reusing Your Code
-In this unit you’ll be introduced to procedures and cloning in Scratch, and you’ll apply these ideas to reuse your code.

Think Like a Software Engineer
-In this unit you’ll follow all the steps of software development to create a fun computer game. You’ll also learn about message broadcasting and concurrency.


Assignment 1 :

Assignment 2 :    


Week : 1


Question 1 :   

Which of the following is an algorithm?

Answer:

How to make a cup of tea:

Put a teabag in a cup

If you don’t have any hot water

boil some

Pour the hot water into the cup

Wait for 3 minutes

Remove the teabag from the cup

 

Question 2 :

 Which programming construct can you identify in this algorithm for making breakfast?

Answer:  Sequence

 

Question 3 :

Please use a pen and paper and follow the algorithm below. Which letter will be drawn?

Position the pen at the top right part of the page

Draw a horizontal line

From the middle point of this line draw a vertical line downwards, until it reaches the bottom part of the page

Ans : T

 

Question 4 :

The following algorithm:

Answer: washing your hands

 

Question 5

We have created a new project in Scratch and we have defined the following program for the cat:

We have chosen the following rotation style for the cat:

What happens when we execute this program?

Answer: The cat keeps moving and every time it bounces its image stays the same.

 

Question 6

The following flowchart depicts an algorithm for leaving your house on a winter’s day. Which of the following are not valid execution paths?

Answer: All the above options are valid execution paths.

 

Question 7

We want to create a program where the cat keeps moving all the time and bounces whenever it touches the edge of the screen. If at any point the cat touches something green, the cat should change colour. Which of the following scripts captures this?

Answer :

 

Question 8

In a new project, we have created the following program for the cat:

Answer:It will keep moving to the right, and whenever it touches the edge, it will be repositioned at 200,0.

Question 9

Let’s suppose that in the project for “Sunny Day” the stage background looked like this, so the sun is located on the right:

Answer  : set the coordinates in the "go to" block to x: 200, y: 105, and set the block "point in direction” to -90

 

Question 10

We have created an animation with two characters, Tim and Lucy. Tim’s code is:

Answer: No, Lucy talks first, saying all her lines, and then Tim talks, saying all his lines.

 

Week 2

 

Question 1

How many meters does Cody walk in total according to this algorithm?

Answer: 400

Question 2

We are preparing a cup of tea for Mary by following the algorithm depicted in the flowchart below. What is the minimum number of teaspoons of sugar to add? Note that we have not given you any information about Mary's sugar preferences. You are expected to to think about the minimum number of teaspoons Mary would like in her tea.

Answer: 0, in other words Mary likes her tea without sugar

 

Question 3

Which of the following statements is correct about these three programs?

Answer: Program 1 and Program 2 reproduce the same melody.

 

Question 4

We have created the following program.

What does this program draw?

Answer:

Question 5

In Scratch we can set the video transparency to values between 0 and 100. We have used the "set video transparency to" block in a program that makes the cat dance, and we have obtained a rather transparent background, like the one shown in the following picture: It is likely that we have set the video transparency in this program to:

Answer: a high value, such as 80

 

Question 6

When designing our interface, we should think about:

Answer: all of the above

 

Question 7

Are these two programs equivalent?

Answer: No

 

Question 8

We are designing a car racing game. Which of the following could be requirements for this game?

Answer: All the above options are possible requirements.

 

Question 9

When designing a car racing game, we decided to represent the car in a simplified form (i.e. as a red rectangle with 4 black circles for the wheels) and to enable its driving with the use of the arrow keys. Surely, the actual car shapes and the process of driving a car are far more complex. Thus, when designing this game, we are applying the concept of:

Answer: abstraction

 

Question 10

Michael is creating a new game. He wants to move a dinosaur with the arrow keys. More particularly, he wants the dinosaur to move 5 steps to the right when the right arrow key is pressed, and 5 steps to the left when the left arrow key is pressed. He has created the following program, he tested it, but it does not seem work as intended:

 

Week 3

 

Question 1

"A space in the computer’s memory where we can hold information used by our program" would be a definition of:

Answer: variable

 

Question 2

 The use of comments in a program:

 Answer: is recommended, as it could help programmers understand the program more easily.

 

Question 3

The following code:

Answer: All the above are correct.

 

Question 4

We have created a program in which an octopus keeps moving across the screen and whenever it touches the starfish, it says “Hiya!”. Here is the code for the octopus: We now want to modify this program so that the route followed by the octopus is visible on the screen. To achieve this, we could change the current code as follows:

Answer: Introduce a "pen down" block right after the “clear” block (before the “forever” block).

 

Question 5

We have created a simple basketball game in Scratch, and we have defined the variable "points" to represent the number of points a player has scored. We want to increase the player’s points by 3, every time he/she makes a field goal beyond the three-point line. Which of the following instructions should we use to capture this increase?

Answer: change points by 3

 

Question 6

We want to enrich a penalty shootout game as follows: When pressing the up arrow key it should announce whether we have scored many goals (if more than 5 goals), some (if 1, 2, 3, 4 or 5 goals) or none (if 0 goals). One way to program this would be:

 

Question 7

In the game "Guess the number" we have defined the variable "secret number", which corresponds to the number the player needs to guess, and we have set its value with the use of the following block: We want to modify the game, so that instead of having to guess a random number between 1 and 10, it should be a random number between 1 and a value indicated by the player. One way to program this is by replacing the previous block with:

Question 8

Rebecca has modified the program for the game "Guess the Number", so it looks like this: Which of the following statements does not hold for Rebecca’s version of the game?

Answer: If at the beginning the player enters a number different to 5, the program says "Not really...try again!", and then the player can enter a new number.

Question 9

Here is the program that we have created for the "Flower Garden" animation: We have modified the interface of the program to have two costumes for the flower: a purple and a blue one. We now want to modify our code so that each row will have flowers of the same colour, with the colours alternating by row, for example as shown in this picture:To achieve this, we need to introduce a "next costume" block:

Answer: inside the first “repeat” block, right before the second “repeat” block.

Question 10

We have modified our penalty shootout game so that when pressing the up arrow key, it announces whether we have scored many goals (if more than 5 goals), some (if 1, 2, 3, 4 or 5 goals) or none (if 0 goals). We now want to test our modified program. Out of the following options, which cases would it be best to choose to test this modification?

 Answer: Three cases: where 0 goals have been scored, 4 goals have been scored and 7 goals have been scored.

 

Week 4

 

Question 1

 We have created the following program for a balloon. The block "say y position" involves saying the value of the y-coordinate of the character at the current point of execution.

What will the balloon say when we run this program?

Answer: 40

 

Question 2

In the game for “Catch the mouse”, we assume that the cat is always located at x = -18, y = 0 at the beginning of the program execution. In this game, we have defined a “jump” procedure as follows:Anna and Bob have implemented this procedure in a different way, as shown in the following examples:

 Answer: Example A does not implement the "jump" procedure correctly, as it involves moving 100 steps downwards and then 100 steps upwards.

Question 3

What does the following program draw?

 

Question 4

John has built the following program for drawing a triangle, the sides of which should have a user-specified length.

 Answer: Instead of "move 100 steps" it should be "move side_length steps".

 

Question 5

 We have created the following program for drawing a staircase that has a user-specified number of stairs: To complete this program, we need to specify a "drawStaircase" block that has the number of stairs to be drawn as a parameter, and which uses the “drawStair” block. Which of the following block definitions captures this?

Question 6

In Scratch there are several blocks related to cloning. In particular, if we want to specify the behaviour a clone will have when it is created, we should use the block:

Answer: "when I start as a clone"

 

Question 7

Modularity is the extent to which a program is separated into different components, which are dedicated to a particular functionality. We have created two equivalent programs for drawing a hexagon. Which of these can be characterised as modular?

Question 8

 We want to create a program with several tigers. In which of the following cases would you recommend not to use clones in our program?

Answer: We want to have 2 tigers. The first tiger will roar when touching the mouse-pointer, while the second will roar when the spacebar is pressed.

 

Question 9

In the animation of the "Wave" we have specified the following code for populating the stands:

In addition to this code, we have defined the behaviour of each spectator with the use of the “when I start as a clone” block, and we have also defined their costumes.

Would it have been the same, if instead of "create clone of myself" we had used the “stamp” block?

Answer: No, the populated stands would look similar, but they would not have the same behaviour. The “stamp” block creates a fixed image of the sprite at the time of stamping, and the stamped sprite has no behaviour.

 

 

Question 10

 We have created a program for drawing squares. We now want to modify it so that it draws rectangles. Our rectangle-drawing program is a(n) __________ of our square-drawing program.

 

Answer: generalization

 

Week 5

 

Question 1

When creating a new game, it would be good to follow the different software development phases in the following order:

Answer: Requirements, Design, Implementation, Testing

 

Question 2

Concurrent processes:

 Answer: run simultaneously

 

Question 3

 We want to create our version of the "Flappy Bird" game, where the player makes a bird fly between rows of pipes without touching them. If the bird touches a pipe, the game ends. The pipes appear every 5 seconds. Each pipe appears at the right edge of the screen and it slides towards the left. When it reaches the left edge of the screen, it disappears. We have successfully built the code for the bird, and we have the following code for the pipe: How should we complete this code for the pipe? Note that the block "y position" reports the y position of the sprite.

Answer: We should introduce a "create clone of myself" block inside the forever block, and we should also introduce a "delete this clone" block right after the “glide” block.

 

Question 4

We want to create a program for a dinosaur, where it keeps moving (and bouncing if on edge) without ever stopping. Three seconds after the program starts execution, the dinosaur should say “It’s time to get bigger!” and then it should get bigger. Which of the following programs implements this behaviour?

Question 5

There is only one approach to developing software: the incremental approach.

Answer: False

 

Question 6 We’ve created a new project with 2 characters: a cat and a dog. This is the program for the cat: We want to create a program for the dog so that it says "So there you are!" once the cat becomes visible on the screen. Which of the following scripts achieves this?

 

  

 

Question 7

We have specified the following condition: This condition is true when:

 Answer: the score variable has a value greater than 10 and the object is touching the edge.

 

Question 8

In the zombie game, if we wanted to have another costume for the Hero sprite that makes zombies go away (in addition to those for the broom and Cody), we could do the following:

Answer: We could add another costume for the Hero sprite and we could extend the program for the Hero so that the user can choose this costume.

 

Question 9

We have created a program where we have a wizard and a knight. The wizard’s code looks like this: while the knight’s code looks like this: When will the knight turn into a frog?

 Answer: Whenever the wizard passes by the centre of the stage.

 

Question 10

You have created a game in Scratch that is similar to Pacman. By sharing your project on the Scratch website, you allow other people to:

 

Answer: all of the above

No comments:

Post a Comment

if you have any doubt please let me know