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

  Explaining class with no constructors

How many constructors can a class have? Can you have a class with no constructors? If a class has more than one constructor, which of them gets called?

  Write application contain classes to accept names of colours

Write the application comprised of three classes. First class called Crayon represents one crayon of particular color and length (height). Enure that constructor is overloaded

  Ms word versus other processing program

MS word Versus other processing program

  Create class polynomial is array of terms

Create the class Polynomial. Internal representation of the Polynomial is the array of terms. Each term contains the coefficient and the exponent.

  Write the program by declaring one-dimensional array

Write the program by declaring one-dimensional array which could be used to hold data for grades (int type) of 10 students. The program will prompt user for numeric grades.

  Program to overload addition operator

The class should also provide the following overloaded operator capabilities: Overload the addition operator (+) to add two Polynomials.

  Explain book constructor to accept and initialize data

Create and execute the class called Book which contains instance data for title, author, publisher, and copyright date. Explain the Book constructor to accept and initialize this data.

  Program to print smallest number and largest number entered

Write C++ program; LargestSmallest.cpp; which inputs six real numbers from user and determines and prints smallest number and largest number entered.

  Find x from n by n matrix of sorted integers

We want to find out if x is present in M.  It is straightforward to do this in O(n log n) time. Explain such algorithm. (b) Can you do better? Describe your solution

  Prepare a shift cipher

In cryptography, a Caesar cipher, also called a shift cipher, encrypts a plaintext string by shifting the letters by a fixed number of positions shift_by.

  Using unix extract the various ethnic populations in file

Using Unix extract the various ethnic populations in your file.

  Write a code to locate and rank keywords

You are working on the custom Web application to design document library for client. Write code to locate and rank the keywords. You have been given sample document to use for testing.

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