1- Write your own scripts to perform the following tasks: a) A for loop that multiplies...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1- Write your own scripts to perform the following tasks: a) A for loop that multiplies all even numbers from 2 to 10. b) A for loop that assigns the values 10, 20, 30, 40, and 50 to a vector. 2- Given the vector x=[1 8 3 9 0 1] use a for loop to: a) Add up the values of all elements in x. b) Compute the cumulative sum, i.e 1; 9; 12; 21; 21; 22, of the elements in x. 1- Write your own scripts to perform the following tasks: a) A for loop that multiplies all even numbers from 2 to 10. b) A for loop that assigns the values 10, 20, 30, 40, and 50 to a vector. 2- Given the vector x=[1 8 3 9 0 1] use a for loop to: a) Add up the values of all elements in x. b) Compute the cumulative sum, i.e 1; 9; 12; 21; 21; 22, of the elements in x.
Expert Answer:
Answer rating: 100% (QA)
Here are the scripts in Python for the tasks youve described python Task ... View the full answer
Related Book For
Introduction to Management Science A Modeling and Cases Studies Approach with Spreadsheets
ISBN: 978-0078024061
5th edition
Authors: Frederick S. Hillier, Mark S. Hillier
Posted Date:
Students also viewed these computer network questions
-
Which do you think are more important to emphasize in a literature review, the opinions of experts in the field or related studies and why? Describe the kind of behaviours that individual team...
-
The following additional information is available for the Dr. Ivan and Irene Incisor family from Chapters 1-5. Ivan's grandfather died and left a portfolio of municipal bonds. In 2012, they pay Ivan...
-
What functions are there in the mazeAsn4 module: print_maze(maze) Description: This function displays the maze. The accessible cells are labelled G i.e. green, the blocked cells are labelled R i.e....
-
23 On January 1, 2021, a company had an existing deferred tax liability attributable to a temporary difference of $20,000. The tax rate at this time was 30%. During 2021, a new law was passed that...
-
A research firm conducted a survey to determine the mean amount steady smokers spend on cigarettes during a week. They found the distribution of amounts spent per week followed the normal...
-
On 1 January 19X6 the following balances, among others, stood in the books of T Thomas: (a) Lighting and heating, (Dr) 277. (b) Insurance, (Dr) 307. During the year ended 31 December 19X6 the...
-
Production and Consumption. What is the production and consumption of China and France without trade? They assume that China and France each have 1,000 production units. With one unit of production...
-
Richardson Services Ltd. was formed on May 1, 2017. The following transactions took place during the first month. Transactions on May 1: 1. Shareholders invested 50,000 cash in exchange for ordinary...
-
The income statement for Slumber Company is divided by its two product lines, blankets and pillows, as follows: Blankets Pillows Total Sales revenue $630,000 $299,000 $929,000 Variable costs...
-
The data file agstrat.dat also contains information on other variables. For each of the following quantities, plot the data, and estimate the population mean for that variable along with its standard...
-
Larned Corporation recorded the following transactions for the just completed month. a. $87,000 in raw materials were purchased on account. b. $85,000 in raw materials were used in production. Of...
-
Malcolm, the son of the founder of Solverham plc, is aware that the managing director of the company believes that the company is strong, and is doing well, but the chief accountant says that the...
-
Why is a bank credit card sale treated the same as a cash sale?
-
What are two reasons why a customer might prefer online shopping?
-
Analyse a number of companies cash flow statements. Which figures seem to give the best indication of a companys performance? Can free cash flow be assessed, and does it provide a useful indicator?
-
What accounts are debited when distributing remaining cash to partners during liquidation?
-
ts 1. Compare and contrast two different points of view on expanding trade by accessing the websites of the U.S. Chamber of Commerce, an industry coalition promoting increased access to and from...
-
Find the image of x = k = const under w = 1/z. Use formulas similar to those in Example 1. y| y = 0 -21 -2 -1 -1, /1 12 T -1 -1 y= -2 x =0
-
a. Determine the amount of potatoes and green beans Maria should purchase each week for the casserole to minimize the ingredient costs while meeting nutritional, taste, and demand requirements....
-
Yakima Construction Corporation (YCC) is considering a number of different development projects. The cash outflows that would be required to complete each project are indicated in the table below,...
-
Weenies and Buns is a food processing plant that manufactures hot dogs and hot dog buns. They grind their own flour for the hot dog buns at a maximum rate of 200 pounds per week. Each hot dog bun...
-
What is the value added ratio? What does a high (low) value added ratio indicate?
-
What does a low average reserves per well ratio indicate?
-
Lomax Company reported the following costs on its financial statements (in thousands): REQUIRED: Using the reserve disclosure for Lomax Company in problem 13 and the data presented in this problem,...
Study smarter with the SolutionInn App