
Write pseudocode for an
integer arrays A and B and does the following:
(i) calculates the array C, the sum of the two arrays
(ii) calculates the array D = 3C
(iii)Calculates the difference between S1, the sum of the elements in the first array and
S2, the sum of the elements of the second array.
(b) Using python, implement the algorithm MatrixManip.
Be sure to output the results to the screen.
(c) Using a random number generator, populate two 5 x 5 matrices with numbers in the range
from -30 to +50. Display your two arrays and the answers for part (a) above.

Solution:
Given,
i) calculates the array C, the sum of the two arrays
(ii) calculates the array D = 3C
(iii)Calculates the difference between S1, the sum of the elements in the first array and
S2, the sum of the elements of the second array.
(b) Using python, implement the algorithm MatrixManip.
Be sure to output the results to the screen.
(c) Using a random number generator, populate two 5 x 5 matrices with numbers in the range
from -30 to +50. Display your two arrays and the answers for part (a) above.
Step by stepSolved in 5 steps with 3 images

- In python, count the neighboring *'s of each individual element in this array: * * . . . . . . . . . * . . . then output an array where each element is replaced with the numbers of *'s above below and diagonal to them. The output should look like this: * * 1 0 0 3 3 2 0 0 1 * 1 0 0arrow_forwardArray. Make the code as simple as possible.arrow_forwardPython Programmingarrow_forward
- Consider the following pseudocode. In this pseudocode, the function mystery has three parameters: array A[] is an int array, size represents the number of element of the A[], and value represents an int value. mystery (A[], size, value) 1.start = 0, end = size – 1, index = -1+1 2. repeat steps 3 to 6 while (start <= end) 3. x = (start + end)/2 + 2 4. if(value == A[x]) a. index = x+1 b. start = x+1 5. else if (value <-A[x]) a. end = x – 1-1.0 6. else a. start = x + 1+1 7. return index Suppose A[8] = {1,1,3,3,5,5,5,7}. What value the function mystery will return for a function call of mystery (A, 8, 5)? What is the timing complexity of the function mystery?arrow_forwardIn Python, Compose a program that takes two inputs m and n and produces an m-by-n boolean array where each element is a ".".arrow_forwardCAN THIS PLEASE BE DONE In PYTHON? Input a list of employee names and salaries and store them in parallel arrays. End the input with a sentinel value. The salaries should be floating point numbers Salaries should be input in even hundreds. For example, a salary of 36,510 should be input as 36.5 and a salary of 69,030 should be entered as 69.0. Find the average of all the salaries of the employees. Then find the names and salaries of any employee who's salary is within 5,000 of the average. So if the average is 30,000 and an employee earns 33,000, his/her name would be found. Display the following using proper labels. Save your file using the naming format LASTNAME_FIRSTNAME_M08 FE. Turn in your file by clicking on the Start Here button in the upper right corner of your screen. 1.Display the names and salaries of all the employees. 2. Display the average of all the salaries 3. Display all employees that are within 5,000 range of the average.arrow_forward
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education





