Write a function that accepts an array a as input and

Assignment Help Programming Languages
Reference no: EM13626306

Write a function that accepts an array a as input, and searches the contents of the array for elements in three different ranges: [0 - 10), [10 - 50) and [50 - 100]. The function builds three arrays that contain the elements from the a array that are in found in each range. These 3 arrays are the output arguments. For an input of a=[2 5 36 70 40 62 8],your program should return these three arrays

x = [2 5 8]
y = [36 40]
z = [70 62]

If the input has no elements in a specific range, the corresponding output array should be empty. If any element in a is greater than 100 or is negative, the program should display the element and the index where it is found using fprintf , and then use the error function to terminate the program. Make sure your program prints all the invalid elementsin the format shown before terminating it using error.

 

Reference no: EM13626306

Questions Cloud

The time it takes alice to walk to the bus stop from her : the time it takes alice to walk to the bus stop from her home is normally distributed with mean 13 minutes and variance
The moment of inertia of a 40m long board pivoted at its : the moment of inertia of a 4.0m long board pivoted at its center is 25kgm2. find the moment of inertia when it is used
Refrigerant-134a is being transported at 1kgs through a : refrigerant-134a is being transported at .1kgs through a teflon tube of inside diameter di 25mm and outside diameter
Moreover the manufacturer believes the lifetime of the : suppose a car manufacturer believes its windscreen wipers will last on average for three years on their cars if driven
Write a function that accepts an array a as input and : write a function that accepts an array a as input and searches the contents of the array for elements in three
Consider a 2210 lb automobile clocked by law enforcement : consider a 2210 lb automobile clocked by law enforcement radar at a speed of 85.5 mph. if the position of the car is
Write a matlab script m-file to play a guessing game the : write a matlab script m-file to play a guessing game. the user will try to guess a number between 1 and 100. your
What is the uncertainity in the position of an electron : german physicist werner heisenberg related the uncertainity of an objects position triangle x to the uncertainity in
A heat engine accepts 200000 btu of heat from a source at : a heat engine accepts 200000 btu of heat from a source at 1500 r and rejects 100000 btu of heat to a sink at 600 r.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd