Assignment 1C F4AB - Introduction
Assignment 1C F4AB - Introduction
Introduction
Assignment Instructions
The questions in this assignment give you practice in typing in and editing programs.
Note: If you copy and paste code, you will most probably have problems submitting it to the
Automarker. Furthermore, leave the author of the code as “Hussein Suleman” as that will be a way
of referencing/acknowledging the author. Remember that if we do not acknowledge the author, that
constitutes plagiarism.
You may need to create directories as per the instructions in the orientation manual.
# Program to guess a secret number
# Hussein Suleman
# 10 February 2011
This program is a classic from the early days of Computer Science. A user is expected to guess
numbers until he or she converges to a secret internal number. At each incorrect guess, the system
lets the user know if the number is too high or too low.
Page 1 of 2
Sample Input/Output (The input from the user is shown in bold):
? 22
lo
? 55
hi
? 42
Correct!
Change each of the messages printed to the screen to be the same as the example output below.
User-friendliness of programs was a concept that gained popularity in the 1980s, where programs
were made easier for human beings to identify with. This has since grown into the current field of
Usability Engineering, which you will learn about while studying Computer Science.
Sample Input/Output (The input from the user is shown in bold font):
What is the secret number? 14
That is way too low. Please try again.
What is the secret number? 337
That is much too high. Please try again.
What is the secret number? 48
That is much too high. Please try again.
What is the secret number? 40
That is way too low. Please try again.
What is the secret number? 0
That is way too low. Please try again.
What is the secret number? 42
Congratulations, you have guessed the secret number!
Submission
Create and submit to the automatic marker a Zip file called ABCXYZ123.zip (where ABCXYZ123 is
YOUR student number) containing secret.py, and secret_2.py.
Page 2 of 2