Question: Problem 1 Complete the function MiniProject 1 , which takes one positive integer ( endValue ) as an input argument. Within the function, generate an
Problem
Complete the function MiniProject which takes one positive integer endValue as an input argument. Within the function, generate an array of odd integers from to
endValue, and array of even numbers between and endValue, and an array with decreasing numbers from endValue to
The input Argument
endValue: a positive integer.
The output Arguments:
oddiNumbers: an array of odd numbers between and endiValue from smallest to largest
evenNumbers: an array of even numbers between and endValue from smallest to largest
reverseNumbers. an array of numbers decreasing from endValue to
Note: while the output arrays are doubleprecision 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
calling the function:
oddNumbers evenNumbers, reverseNumbers ReturnNumbers endValue
Qutouts:
oddivumbers
evenNumbers
reverseNumbers
The oddilumbers array contains odd numbers in the range to
The evenNumbers array contains even numbers in the range to
Tho reversel Numbers array contains numbers from to in decreasing order.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
