Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Mini - Project 3 Write a function called FindPrimes that takes 2 scalars, lowerRange and upperRange, and produces 2 output arrays called outOdds and outPrimes.

Mini-Project 3
Write a function called FindPrimes that takes 2 scalars, lowerRange and upperRange, and produces 2 output arrays called outOdds and outPrimes.
Step 1: The function first.finds all the odd numbers within the range defined by lowerRange and upperRange, limits inclusive. The output outOdds is a 1D array with all the odd
numbers, except integer multiples of 5, within the specified range.
Step 2: outPrimes contains all prime numbers above the lowerRange in ascending order while the sum of the outPrimes is less than the highest element of outOdds.
The input arguments (lowerRange, upperRange) are two (numeric) scalars.
The output argument (outOdds) and (outPrime) are 1xm(numeric) arrays.
Hint: Use isprime to check if a numer is prime.
For example: For the given inputs:
lowerRange =2;
upperRange =20;
On calling FindPrimes:
[out0dds, outPrimes]= FindPrimes ( lowerRange, upperRange)
produces,
out0dds=[37911131719]
outPrimes =[2357],
Function o.
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_2

Step: 3

blur-text-image_3

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

Intranet And Web Databases For Dummies

Authors: Paul Litwin

1st Edition

0764502212, 9780764502217

More Books

Students also viewed these Databases questions

Question

3. How frequently do the assessments occur?

Answered: 1 week ago