Page 157 - ThinkGPT_V2.1_C7_Flipbook
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
   152   153   154   155   156   157   158   159   160   161   162