Page 157 - Digicode_AI_class_7
P. 157
MakeCode Leadership & Responsibility
Critical Thinking
Eat the Fruit
E. Create a game with three sprites, one will be a Player sprite, second will be Fruit sprite and
another will be a Junk food sprite.
Objective of the game:
Move your sprite around the screen and eat as much fruit as you can before the time runs
out!
Every time the fruit is caught, points are added, and the timer is restored.
You will be given three lives to play the game, once you hit third time to the junk food, your
game will be over.
Code:
Output:
Python Critical Thinking
F. Write a program to convert the time given into minutes in hours and minutes.
G. Write a program to convert the distance (in feet) into inches, yards, and miles.
Hint:
dis_inches = dis_ft * 12
dis_yards = dis_ft / 3.0
dis_miles = dis_ft / 5280.0
H. Write a program to print numbers in ascending order using if-else statement.
Practical Assessment 155

