Question: Problem 1 Complete the function MiniProject 1 , which takes one positive integer ( endValue ) as an input argument. Within the function, generate an

Problem 1
Complete the function MiniProject1, which takes one positive integer (endValue) as an input argument. Within the function, generate an array of odd integers from 1 to
endValue, and array of even numbers between 1 and endValue, and an array with decreasing numbers from endValue to 1.
The input Argument
endValue: a positive integer.
The output Arguments:
oddiNumbers: an array of odd numbers between 3 and endiValue from smallest to largest
evenNumbers: an array of even numbers between 3 and endValue from smallest to largest
reverseNumbers. an array of numbers decreasing from endValue to 3.
(Note: while the output arrays are double-precision numbers, the input is an integer.)
Restrictions: Do not use loops, sort or if else statements.
Hints: Use array indexing to generate the required numbers to create the odd, even, and reverse output arrays.
Foc example, with the function ReturnNumbers, given the integer:
lnouts:
endvalue =13
calling the function:
[oddNumbers, evenNumbers, reverseNumbers]= ReturnNumbers (endValue)
Qutouts:
oddivumbers =
13
evenNumbers =
3
24
reverseNumbers =
13,12,11,10,9,8,7,6,5,4,3,1
The oddilumbers array contains odd numbers in the range 1 to 13.
The evenNumbers array contains even numbers in the range 2 to 12.
Tho reversel Numbers array contains numbers from 13 to 1 in decreasing order.
 Problem 1 Complete the function MiniProject1, which takes one positive integer

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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!