Array Arithmetic Exception Problems
Array Arithmetic Exception Problems
A to-do list app allows users to update tasks by index. Handle invalid indexes gracefully.
Sample Input:
Sample Input:
Input Index: 5
Sample Output:
Sample Output:
A system stores marks for 5 subjects. Handle invalid array indexes while viewing/updating marks.
Sample Input:
Sample Input:
Input Index: 7
Sample Output:
Sample Output:
Orders are stored in an array. Handle attempts to access invalid order indices.
Sample Input:
Sample Input:
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Input Day: 5
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Input Index: 10
Sample Output:
Sample Output:
Sample Input:
Enter numerator: 10
Enter denominator: 0
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Income: 50000
Dependents: 0
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Numbers: []
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Balance: 10000
Months: 0
Sample Output:
Sample Output:
Winning percentage is calculated by dividing wins by matches played. Handle matches being zero.
Sample Input:
Sample Input:
Wins: 5
Matches: 0
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Array: [1, 2, 3]
Index: 5
Denominator: 0
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Salaries: []
Sample Output:
Sample Output:
Perform division of matrix elements and handle invalid indices or division by zero.
Sample Input:
Sample Input:
Index: (2,2)
Sample Output:
Sample Output:
Access scores in an array or divide scores. Handle invalid indices or zero divisions.
Sample Input:
Sample Input:
Scores: [10, 20, 30]
Index: 5
Sample Output:
Sample Output:
Sample Input:
Sample Input:
Index: 5
Divisor: 0
Sample Output:
Sample Output: