A automated warehouse shelf uses a coordinate system of rows and columns. A technician wants to ensure that the weights of items loaded on the first row (row 0) are in strictly decreasing order from left to right to prevent structural tipping.
Write a Python program to:
You must use the getWeight subroutine described below in your Python code.
| Subroutine | Purpose |
|---|---|
getWeight(row, column) | Returns the weight (as an integer) of the item positioned at (row, column) |
| column 0 | column 1 | column 2 | |
|---|---|---|---|
| row 0 | 45 | 50 | 30 |
| row 1 | 20 | 15 | 10 |
For Example A, the program should display Unsafe (because 50 is not less than 45).
| column 0 | column 1 | column 2 | |
|---|---|---|---|
| row 0 | 80 | 70 | 50 |
| row 1 | 30 | 40 | 10 |
For Example B, the program should display Safe (80 > 70 > 50).
131 exam-style questions on AQA GCSE Computer Science Structured programming and subroutines (procedures and functions). Each one has a worked solution and a mark scheme showing where the marks go.