Monday 9 May 2016

Functions Test

Unit 3 Functions Test




First off a lot of you are going to be tempted to cheat on this.  DON'T DO IT.  You are challenging me to make you suffer by doing so.  I am hunting for cheaters today.  Cheaters deserve huge, horrible punishments to learn not to do that again.  Do your best and get the mark you deserve. 

Create a program which does the following:

1.  It asks you what your name is by activating a function from #main   (2 marks)
2.  It says "Hi " + the name entered in part 1 (in #main). (1 mark)
3.  It activates a random number generating function to get a number from 1 to 10
.  (4 marks)
4.  It tells you what the random number was in #main.  (1 mark)
5.  It runs a function that will activate a for-loop.  The for-loop will print the person's name a number of times equal to the random number that was generated in step 3 above. (5 marks)
6.  It will ask you if you want to run the program again (in #main).  If the person says anything but "no", it repeats from the start.   (1 mark)
7. If the person says no, it activates a function to say "Bye" + the name of the person. It will return to main to saying "Exiting..." and the program will quit in #main.  (5 marks)
8. This program must have your name in comments at the top (1 mark)

20 Marks Total.

To be marked, you must name your program with the following format:
FIRSTNAME.LASTNAME-FunctionsTest.py

Failure to label your program properly can result in a penalty.

Your output should look like the following.



Including your name, you can do this program in 26 lines in 20 minutes. You have the entire class to email this to me.

No comments:

Post a Comment