QUIZ 6
COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_6.py
Enter three positive integers: 0 1 2
Here is the grid that has been generated:
11
01
$ python3 quiz_6.py
Enter three positive integers: 0 1 3
Here is the grid that has been generated:
110 111 111
For steps of size 2, we have:
2 stairs with 1 step
$ python3 quiz_6.py
Enter three positive integers: 0 3 9
Here is the grid that has been generated:
110111111 111101110 011011111 110001011 110111110 011011011 110111111 101100110 011111111
For steps of size 2, we have:
5 stairs with 1 step
1 stair with 2 steps
1 stair with 3 steps
1 stair with 4 steps
For steps of size 3, we have:
4 stairs with 1 step
Date: Trimester 2, 2020.
2 COMP9021 PRINCIPLES OF PROGRAMMING
$ python3 quiz_6.py
Enter three positive integers: 0 3 7
Here is the grid that has been generated:
1101111 1111110 1110011 0111111 1000101 1110111 1100110
For steps of size 2, we have:
2 stairs with 1 step
2 stairs with 2 steps
For steps of size 3, we have:
1 stair with 2 steps
$ python3 quiz_6.py
Enter three positive integers: 0 4 8
Here is the grid that has been generated:
11011111 11111111 01111110 01110111 11111110 10010111 11011111 11001110
For steps of size 2, we have:
7 stairs with 1 step
3 stairs with 2 steps
2 stairs with 3 steps
For steps of size 3, we have:
2 stairs with 1 step
1 stair with 2 steps
For steps of size 4, we have:
1 stair with 1 step
$ python3 quiz_6.py
Enter three positive integers: 0 5 9
Here is the grid that has been generated:
110111111 111111101 111111010 111101111 111111101 001111101 111111011 111110011 101111011
For steps of size 2, we have:
4 stairs with 1 step
5 stairs with 2 steps
1 stair with 3 steps
2 stairs with 4 steps
For steps of size 3, we have:
9 stairs with 1 step
For steps of size 4, we have:
2 stairs with 1 step
QUIZ 6 3