Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started