How to Solve using python 9.12 Lab 9D: Identity Matrix Overview Create a program that will print
Fantastic news! We've Found the answer you've been seeking!
Question:
How to Solve using python
Transcribed Image Text:
9.12 Lab 9D: Identity Matrix Overview Create a program that will print an identity matrix whose size is specified by the user Objectives To be able to get practice using nested loops. Description An identity matrix in math is a square matrix whose contents are all 0, except there are 1s down the main diagonal. For example, a 3 x 3 identity matrix looks like this: 1 0 0 0 1 0 0 0 1 and a 5 x 5 identity matrix looks like this: 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 You will first prompt the user for the size of the matrix (number of rows and columns), then print the identity matrix of that size. After printing the first matrix, you must ask the user if they want to continue as follows: Do you want to print another? You will continue to ask for a size and print an identity matrix until the user says 'n'. When the user says 'n', you should print the message "Thank you Development Suggestions 9.12 Lab 9D: Identity Matrix Overview Create a program that will print an identity matrix whose size is specified by the user Objectives To be able to get practice using nested loops. Description An identity matrix in math is a square matrix whose contents are all 0, except there are 1s down the main diagonal. For example, a 3 x 3 identity matrix looks like this: 1 0 0 0 1 0 0 0 1 and a 5 x 5 identity matrix looks like this: 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 You will first prompt the user for the size of the matrix (number of rows and columns), then print the identity matrix of that size. After printing the first matrix, you must ask the user if they want to continue as follows: Do you want to print another? You will continue to ask for a size and print an identity matrix until the user says 'n'. When the user says 'n', you should print the message "Thank you Development Suggestions
Expert Answer:
Answer rating: 100% (QA)
Every concept has been explained by adding comments to it Python Code Start an infinite while l... View the full answer
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date:
Students also viewed these programming questions
-
How to solve using 4th order Runga Kutta Method using Excel? dx = sin(x) + cos((y) dt dy cos(x) sin(y) dt x(0) = 1, y(0) = 1 h = 0.1 Solve until t = 10
-
Solve using Python spyder. The airline_delay on the right is just a snapshot of the file. explain in steps. Origin Airport: LGA STEP 1 Flights from LGA was on time 5033 times. Flights from LGA was...
-
Solve using lisp program not python or java. ( lisp emacs ) Write a function called filter-seq that takes a sequences (a string) and an alphabet a (a string), and generates a result sequence (a...
-
How would you compare the value of direct definition from friends in face-to-face conversation and strangers comments on a YouTube posting?
-
Your portfolio allocates equal amounts to three stocks. All three stocks have the same mean annual return of 16 percent. Annual return standard deviations for these three stocks are 30 percent, 40...
-
Banyan Co.s common stock currently sells for $46.75 per share. The growth rate is a constant 6%, and the company has an expected dividend yield of 5%. The expected long-run dividend payout ratio is...
-
What do we mean by the term relevant evidence?
-
Verizox Company uses a job order cost system with manufacturing overhead applied to products based on direct labor hours. At the beginning of the most recent year, the company estimated its...
-
The following schedule presents the beginning inventory, purchases and sales for Evan Corporations major product during the month of May. The company uses the perpetual approach only for units of...
-
Schank Marketing Research has just signed contracts to conduct studies for four clients. At present, three project managers are free for assignment to the tasks. Although all are capable of handling...
-
Which is the only factor payment whose amount is uncertain? rent profit energy prices
-
Consider a theory which states that an increase in interest rates will lead to an increase in savings. How would the principle of ceteris paribus be important in investigating the predictive power of...
-
Would you expect economists to disagree less about public policy as time goes on? Why or why not? Can their differences be completely eliminated? Why or why not?
-
Does the fact that there are different schools of thought in economics reduce its validity as an academic discipline?
-
If models are not capable of representing the real world in any detail and rely too much on assumptions, then what value can they be?
-
Why do differences in values lead to disagreements among economists?
-
In the Sales Message process, the actual "Message" is driven from the "Positioning Statement". Both the Positioning Statement and actual Sales Message development are the responsibility of Marketing...
-
What are the before image (BFIM) and after image (AFIM) of a data item? What is the difference between in-place updating and shadowing, with respect to their handling of BFIM and AFIM?
-
In this exercise, you modify the program from Lab 13-2. If necessary, create a new project named Advanced35 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named...
-
Cranston Berries sells three types of berries: strawberries, blueberries, and raspberries. Sales have been booming this year and are expected to increase next year. The sales manager wants a program...
-
You have just purchased a new personal computer system. Before putting the system components together, you read the instruction booklet that came with the system. The booklet contains a list of the...
-
Four identical rigid bars-each of length \(a\) - are connected to a spring of stiffness \(k\) to form a structure for carrying a vertical load \(P\), as shown in Figs. 1.72 (a) and (b). Find the...
-
A cantilever beam of length \(L\) and Young's modulus \(E\) is subjected to a bending force at its free end. Compare the spring constants of beams with cross sections in the form of a solid circle...
-
A bar of length \(L\) and Young's modulus \(E\) is subjected to an axial force. Compare the spring constants of bars with cross sections in the form of a solid circle (of diameter \(d\) ), square (of...
Study smarter with the SolutionInn App