Answered step by step
Verified Expert Solution
Link Copied!

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 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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

Explain the different types of marketing strategies.

Answered: 1 week ago

Question

Explain product positioning.

Answered: 1 week ago

Question

Explain Industrial market segment.

Answered: 1 week ago

Question

Question Can a self-employed person adopt a profit sharing plan?

Answered: 1 week ago