Professional Documents
Culture Documents
Challenge in Groups
Challenge in Groups
Please work through the following levels in your group, clearly showing the code for each level.
You may comment out a finished level before moving on to the next.
As part of your comments for each level, include your test cases.
Level 2
Write a program that asks the user to input a 3 digit number. Check if it has a length of 3.
Output appropriately.
For example:
Please enter 3 digits: 34
I asked for 3 digits.
Level 3
Modify your program to also check that it is all digits and that the first number is not zero. Output
appropriately.
For example:
Please enter 3 digits: 03a
I asked for digits.
Level 4
Modify your program to check that no numbers are the same. Output appropriately.
For example:
Please enter 3 digits: 227
Please ensure that all numbers are different.
Level 4+
Modify your program to reverse the number and subtract the lowest number from the largest.
Display the answer.
For example:
Please enter the number: 345
Reverse: 543
543-345=198