Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Instructions : Using Python 3, the user should be able to create a matrix of any dimensions and perform either the apply or transpose operations

Instructions : Using Python 3, the user should be able to create a matrix of any dimensions and perform either the apply or transpose operations to it.

1. Print welcome message.

2. Ask the user to enter the number of rows and columns.

3. Create a matrix filled with zeroes with the user input dimensions.

4. Allow the user to enter a float value followed by its row/column location and place the

value at that location until they enter QUIT. If the location coordinates are invalid, have

the user correct them.

5. Print the resulting matrix.

a. Putting a \t will give you a nicer looking output.

6. Allow the user the option to perform an apply, transpose, print, or quit. If apply is chosen,

then they may choose between squaring all elements or multiplying by some value. If transpose is chosen, then transpose the matrix. Both of these transformations are permanent, that is they should aggregate until the user quits. If print is chosen, print the matrix. If quit is chosen, exit the program. All errors from the user should be appropriately handled. a. HINT. For transposing, consider making a new matrix with inverted rows/columns and think about how you are iterating through everything.

7. Show goodbye message.

image text in transcribed

nstructions: Using Python 3, the user should be able to create a matrix of any dimensions and perform either the apply or transpose operations to it 1. Print welcome message. 2. Ask the user to enter the number of rows and columns. 3. Create a matrix filled with zeroes with the user input dimensions . Allow the user to enter a float value followed by its row/column location and place the value at that location until they enter "QUIT. if the location coordinates are invalid, have the user correct them. 5. Print the resulting matrix. a. Putting a t' will give you a nicer looking output. 6. Allow the user the option to perform an apply, transpose, print, or quit. If apply is chosen, then they may choose between squaring all elements or multiplying by some value. If transpose is chosen, then transpose the matrix. Bothlof these transformations are permanent, that is they should ageregate until the user quits. If print is chosen, print the matrix. If quit is chosen, exit the program. All errors from the user should be appropriately handled. a. HINT, For transposing, consider making a new matrix with inverted rows/columns and think about how you are iterating through everything. 7. Show goodbye message 1) APPLY (2) TRANSPOSE (3) PRINT 4) QUIT Choice: 1 What would you like to do? (1) SQUARE 2) MULTIPLY Choice: 2 Amount to multiply by: .12 What would you like to do? (1) APPLY (2) TRANSPOSE 3) PRINT 4) QUIT Choice: 3 1.1869230.00.0 0.0 0.00.0 0.0 0.00.00.0 0,0 0.0 0.0 0,0 0.00.000 0.00.0 0.356433588299999940.00.00.00.00.00.0 0.0 0.0 0.00.000 0.0040362672000000005 0.0 0.0 What would you like to do? (1) APPLY 2) TRANSPOSE (3) PRINT (4) QUIT Choice: 4 Goodbye Example run: Notice when the matrix prints large decimal values push the others over. This is okay for this lab. Welcome to the matrix programl Enter the matrx dimensions. Enter number of rows: 5 Enter number of columns: 7 Enter a value for the matrix or QUIT to stop: 3.145 Enter row location: 0 Enter a column location: 0 Enter a value for the matrix or QUIT to stop: 1.834 Enter row location: 4 Enter a column location: 4 Enter a value for the matrix or QUIT to stop: 1.72345 Enter row location: 2 Enter a column location: 5 Enter a value for the matrix or QUIT to stop: QUIT 3.145 000 000 0000000 00000 1.72345 0 0000000 00001834 00 What would you li ke to do? (1) APPLY (2) TRANSPOSE (3) PRINT 4) QUIT Choice: 1 What would you like to do? (1) SQUARE (2) MULTIPLY Choice: 1 What would you like to do? (1) APPLY (2) TRANSPOSE (3) PRINT (4) QUIT Restrictions L You must properly handle errors in user input. 2. You must use if statements. 3. You must use a while loop. 4. You must use a for loop S. You must have nested loops 6. You must use a matrix structure 7. You must have proper boillerplate. 9.891025000000 0000000 00000 2.9702799024999997 0 000000D 0000 3.3635560000000004 00 What would you like to do? nstructions: Using Python 3, the user should be able to create a matrix of any dimensions and perform either the apply or transpose operations to it 1. Print welcome message. 2. Ask the user to enter the number of rows and columns. 3. Create a matrix filled with zeroes with the user input dimensions . Allow the user to enter a float value followed by its row/column location and place the value at that location until they enter "QUIT. if the location coordinates are invalid, have the user correct them. 5. Print the resulting matrix. a. Putting a t' will give you a nicer looking output. 6. Allow the user the option to perform an apply, transpose, print, or quit. If apply is chosen, then they may choose between squaring all elements or multiplying by some value. If transpose is chosen, then transpose the matrix. Bothlof these transformations are permanent, that is they should ageregate until the user quits. If print is chosen, print the matrix. If quit is chosen, exit the program. All errors from the user should be appropriately handled. a. HINT, For transposing, consider making a new matrix with inverted rows/columns and think about how you are iterating through everything. 7. Show goodbye message 1) APPLY (2) TRANSPOSE (3) PRINT 4) QUIT Choice: 1 What would you like to do? (1) SQUARE 2) MULTIPLY Choice: 2 Amount to multiply by: .12 What would you like to do? (1) APPLY (2) TRANSPOSE 3) PRINT 4) QUIT Choice: 3 1.1869230.00.0 0.0 0.00.0 0.0 0.00.00.0 0,0 0.0 0.0 0,0 0.00.000 0.00.0 0.356433588299999940.00.00.00.00.00.0 0.0 0.0 0.00.000 0.0040362672000000005 0.0 0.0 What would you like to do? (1) APPLY 2) TRANSPOSE (3) PRINT (4) QUIT Choice: 4 Goodbye Example run: Notice when the matrix prints large decimal values push the others over. This is okay for this lab. Welcome to the matrix programl Enter the matrx dimensions. Enter number of rows: 5 Enter number of columns: 7 Enter a value for the matrix or QUIT to stop: 3.145 Enter row location: 0 Enter a column location: 0 Enter a value for the matrix or QUIT to stop: 1.834 Enter row location: 4 Enter a column location: 4 Enter a value for the matrix or QUIT to stop: 1.72345 Enter row location: 2 Enter a column location: 5 Enter a value for the matrix or QUIT to stop: QUIT 3.145 000 000 0000000 00000 1.72345 0 0000000 00001834 00 What would you li ke to do? (1) APPLY (2) TRANSPOSE (3) PRINT 4) QUIT Choice: 1 What would you like to do? (1) SQUARE (2) MULTIPLY Choice: 1 What would you like to do? (1) APPLY (2) TRANSPOSE (3) PRINT (4) QUIT Restrictions L You must properly handle errors in user input. 2. You must use if statements. 3. You must use a while loop. 4. You must use a for loop S. You must have nested loops 6. You must use a matrix structure 7. You must have proper boillerplate. 9.891025000000 0000000 00000 2.9702799024999997 0 000000D 0000 3.3635560000000004 00 What would you like to do

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions

Question

Write short notes on Interviews.

Answered: 1 week ago