1. Write a program to read n data items into two arrays, x and y, of...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. Write a program to read n data items into two arrays, x and y, of size 20. Store the products of corresponding pairs of elements of x and y in a third array, z, also of size 20. Print a three-column table that displays. the arrays x, y, and z. Then compute and print the square root of the sum of the items in z. Make up your own data, with n less than 20. 1. Write a program to read n data items into two arrays, x and y, of size 20. Store the products of corresponding pairs of elements of x and y in a third array, z, also of size 20. Print a three-column table that displays. the arrays x, y, and z. Then compute and print the square root of the sum of the items in z. Make up your own data, with n less than 20.
Expert Answer:
Answer rating: 100% (QA)
Heres the Python program for the task python import numpy as np Generate random data for arrays x an... View the full answer
Related Book For
Numerical Methods With Chemical Engineering Applications
ISBN: 9781107135116
1st Edition
Authors: Kevin D. Dorfman, Prodromos Daoutidis
Posted Date:
Students also viewed these programming questions
-
Compare the similarities and differences of various models of workers representation exist in Japan and USA?
-
Lead nitrate solution is added to a test tube containing potassium iodide solution. (a) Write the name and colour of the compound precipitated. (b) Write the balanced chemical equation for the...
-
The surface area S of the rectangular solid shown in the figure is S = 2(24) + 2(4x) + 2(6x). Find the length x of the solid when the surface area is 248-square centimeters.
-
The All About You feature (available on the books companion website) indicates potential security risks that may arise from your personal computer. It is important to keep in mind, however, that...
-
The induced emf in an inductor of inductance \(L\) varies with time according to \(\mathscr{E}_{\text {ind }}(t)=-2 C t\), where \(C\) is a positive constant. (a) If there is no current through the...
-
1. Describe the various services provided by logistics service providers. What is the role of these services in focal firms value-chain activities? 2. Supply-chain management has evolved over time,...
-
11. An incompressible liquid is kept in a container having a weightless piston with a hole. A capillary tube of inner radius 0.1 mm is dipped vertically into the liquid through the airtight piston...
-
Dry methane is supplied by a compressor and precooling system to the cooler of a Linde liquid-methane system (Fig. 9.6) at 180 bar and 300 K. The low-pressure methane leaves the cooler at a...
-
Rob also examined the external industry trends and made a comparison on the employee turnovers. He conducted an analysis on the turnover ratio to determine the ratings to Victory Private Hospital...
-
Company or Organization: UPS (United Parcel Service) Suggested current strategic issue to be addressed (based upon preliminary data collection) Clearly outline how you will collect data (i.e., what...
-
Replicated databases create considerable data redundancy, which is in conflict with the database concept. Explain the justification of this approach. Contrast the navigational databases with...
-
Given data below answer the questions. Question 4 of 5 Raw materials inventory $33,280 $38,400 Work in process inventory 23,680 28,320 Finished goods inventory 38,400 26,880 Materials purchased...
-
Discuss the key factors to consider in determining how to partition a corporate database. Distinguish between a database lockout and a deadlock.
-
1.Discuss the importance of reporting risk during risk tracking and reporting. 2. Outline the best practices in reporting risk, including regularity, transparency, and clarity of communication.
-
The balance sheet for Agro Inc. shows current assets of $650,000 and capital assets of $1,200,000. Of the current assets, $300,000 can be considered permanent with the remainder being temporary. Agro...
-
When the concentration of a strong acid is not substantially higher than 1.0 10-7 M, the ionization of water must be taken into account in the calculation of the solution's pH. (a) Derive an...
-
What mathematical problem is solved by the following MATLAB code? 1 function x = problem3_8 2 itmax = 100; tol = 0;, x0 = 1; 3 for k=1:itmax 4 5 6 8 9 x=x-f (x)/fprime (x); r=f(x); if abs (r)
-
Using the LU decomposition in Problem 2.32, determine the value of x 2 for Ax = b if the forcing function is Data from Problem 2.32: In LU decomposition, determine the missing value of L for 5 --[:]...
-
Write a MATLAB program that uses centered finite differences to solve the onedimensional diffusion equation for a spatially dependent diffusion coefficient D(x) = D 0 (1 ax) and the boundary...
-
Can you create a graphic that highlights each incidence where Fairmont was not in compliance with company policy that requires explicit approval of all hours of eighty hours or more?
-
In addition to financial reporting fraud, what other types of asset misappropriation schemes were perpetrated by the Rigas family members?
-
Why was Adelphia cable company formed?
Study smarter with the SolutionInn App