.

Saturday, January 4, 2014

Discrete Mathematics For Computing

p MAT1101 Discrete Mathematics f or ComputingAssignment 2Due : Monday 24 May 2010 Weighting : 20Question1[10 marks] (a ) Consider a act which takes as enter a list of numbers (vector x ) and in like manner returns as output a list of numbers (vector y . This enjoyment calculates the average of two consecutive numbers of the infix list . For example , the foreplay vector x [5 , 4 , 2 ?-6] should be returned as output vector y [4 .5 , 3 ?-2] . Note that vector y does contain aesthesis less factor than vector x (i )Write the pseudocode for the repetitious algorithmic rule of this function giving it anappropriate name . You may accept that a primitive function such as lengthisavailable , provided you need to excuse in plain English what this function does .[3] 1 .Declare variables vector_input surf (x , vector_output repres ent (y func_average2 .Enter input array elements3 . inject in inputarray (x1 , x2 .xn4 .
Order your essay at Orderessay and get a 100% original and high-quality custom paper within the required time frame.
Apply function5 .Condition for (1st input element x1 ) to (the gage last element xn-16 .Do7 .Statements yi (x1 x2 /28 .Apply to contiguous element Next x9 .Print out the results Print output array (yi (ii )Trace your pseudocode for the input vector x [5 , 4 , 2 , -6] [2] The function will call for input at pull in 2All the array elements will be stored in locations x1 , x2 .xn-1 , xn respectively as they are enteredThe statements will be executed in a loop as long as the condition holds avowedly ie for (1st input element x1 ) to (the...If you want to get a full essay, order it on our website: OrderEssay.net!

If you want to get a full information about our service, visit our page: write my essay

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.