11. What is the output of this scenario? 1. I have an input of an array of integers: int[] arr = { 4, 100, 2, 50, 7, -45, -23, 84, 51, 120, 98, -72 }. 2. I declare an integer variable which is named...


What is the output of the scenario?
(Using Python Programming)


11. What is the output of this scenario?<br>1. I have an input of an array of integers: int[] arr = { 4, 100, 2, 50, 7, -45, -23, 84, 51, 120, 98, -72 }.<br>2. I declare an integer variable which is named

Extracted text: 11. What is the output of this scenario? 1. I have an input of an array of integers: int[] arr = { 4, 100, 2, 50, 7, -45, -23, 84, 51, 120, 98, -72 }. 2. I declare an integer variable which is named "total". 3. I created a loop. 3.1. The loop control variable value to be declared is 0. This will be represented by the variable "i" and it represent the index of the inputted array. 3.2. The loop has a condition that if the current loop control variable value is greater than or equal to the size of the array minus the first item of the array, the loop will break. 3.3. After the body or function is executed, the loop control variable is incremented by 2. 3.4. The body of the loop has a conditional statement. if arr[i] is even, add it to total, else minus it %3D to the total. 4. After the loop breaks or finishes, i want to display the value of the total.

Jun 08, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here