Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using python 3.7 without using any powerful python modules besides math and copy 3. (30 points) Write a Python program that does the following: a)

image text in transcribed

image text in transcribed

using python 3.7 without using any powerful python modules besides math and copy

3. (30 points) Write a Python program that does the following: a) Defines a function that meets the following specifications: def Column With LargestSum(matrix) matrix; full rectangular list of lists of numbers (we usually call this a matrix). Rectangular means that the number of rows and number of columns are not necessarily equal, The function returns colnumber, colsum colnumber is the column index number of the column in the matrix whose sum is the largest colsum is the sum of the values in that column. Important! If there are two or more columns containing the same largest sum, then return the index of the first of those columns! Hintl: when searching for a maximum value, it is fairly common to have a variable that contains the "current" maximum value you have found so far in the search. It is also fairly common to initialize that variable with an extremely "not-large" value. In this case, -9999 would be an acceptable value. Hint2: when searching for a location containing a maximum value, it is fairly common to have a variable that contains the "current" location of the maximum value you have found so far in the search. It is also fairly common to initialize that variable with an "impossibly early location" value. In this case, - I would be an acceptable value. b) Contains and calls a main() function that does the following: Creates the two matrices shown below, sends Amatrix to Column With LargestSum() and then prints the answer then sends Bmatrix to Column With LargestSum() and then prints the answer. When you print the answers, they should resemble the following: The largest sum is in column 7 an has a value of 217.31 Amatrix - 2 I 13, 12, [1, 2, -1, 8. 5, 4. 3, 1.3, 2] Bmatrix = [ 12, 1, 41. [3,2,5]. (4,2,1). 11.5.21 13, 1,1])

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Datacasting How To Stream Databases Over The Internet

Authors: Jessica Keyes

1st Edition

007034678X, 978-0070346789

More Books

Students also viewed these Databases questions