Question: Task #10: See the vector below called inventory. This vector represents both the price and quantity sold of items from a clothing store. The odd

Task #10: See the vector below called inventory. This vector represents both the price and quantity sold of items from a clothing store. The odd indexes, ( 1, 3, 5, ...) represent the quantity sold of a given item - and the value immediatlely to the right is the corresponding price. Create a vector called revenue which will store the sales revenue of each item (quantity sold * price.) Do not manually copy & paste values - instead use vector indexing and element-wise multiplication, .* , to solve this problem. For reference, revenue should have 6 values, and the first value should be 12 (quantity) * 23.25 (price) ==> 279

Task #11: Find the sum of the first 100 elements in the harmonic series: 1 + 1/2 + 1/3 + 1/4 + .... + 1/100 You can use vector element-wise division in a couple of different ways to generate a vector that houses the above series of numbers. You can then use the sum function to add all 100 elements of that vector together. Save this sum to a new variable called sumHS.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Lets tackle each task step by step Task 10 Step 1 Given Vector The vector inventory contai... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!