Write a program that (a) generates a vector with 20 random integer elements with integers between -10
Question:
Write a program that (a) generates a vector with 20 random integer elements with integers between -10 and 10, (b) replaces all the negative integers with random integers between -10 and 10, (c) repeats (b) until all the elements are positive. The program should also count how many times (b) is repeated before all the elements are positive. When done, the program displays the vector and a statement that states how many iterations were needed for generating the vector.
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 38% (18 reviews)
Script file clear clc vector randi 2012010 iter 0 N1 while N 0 N1 for k120 if v...View the full answer
Answered By
Ali Khawaja
my expertise are as follows: financial accounting : - journal entries - financial statements including balance sheet, profit & loss account, cash flow statement & statement of changes in equity -consolidated statement of financial position. -ratio analysis -depreciation methods -accounting concepts -understanding and application of all international financial reporting standards (ifrs) -international accounting standards (ias) -etc business analysis : -business strategy -strategic choices -business processes -e-business -e-marketing -project management -finance -hrm financial management : -project appraisal -capital budgeting -net present value (npv) -internal rate of return (irr) -net present value(npv) -payback period -strategic position -strategic choices -information technology -project management -finance -human resource management auditing: -internal audit -external audit -substantive procedures -analytic procedures -designing and assessment of internal controls -developing the flow charts & data flow diagrams -audit reports -engagement letter -materiality economics: -micro -macro -game theory -econometric -mathematical application in economics -empirical macroeconomics -international trade -international political economy -monetary theory and policy -public economics ,business law, and all regarding commerce