1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
vaieri [72.5K]
2 years ago
6

Your task is to design a method int[] allMatches(int[] values, int size, int a, int b) that returns all values between a and b i

nclusive in the partially filled array values. For example, if an array a contains 11, 3, 9, 4, 2, 5, 4, 7, 6, 0, then the call allMatches(a, 8, 3, 7) should return an array containing 3, 4, 5, 4, 7. Note that the 6 is not included because it is past the size of the partially filled array. Arrange the pseudocode below in the right order. Not all lines are useful.
ArrayValues. Java Tester.
java for (int v: values)
{ public class ArrayValues public static intti allatches(int[1 values, int size, int, int b) {
} for (int k = 0; k < size; k++) {
int v = values[k]; for (int k = 0; k < size; k++) {
int v = values[k]; for (int v: values) {
result[1] = v; 1++;
}
int count = 0; )
} if (a int[] result = new int[count);
Computers and Technology
1 answer:
iogann1982 [59]2 years ago
5 0

The program that returns all values between a and b inclusive in the partially filled array values is illustrated below.

<h3>What is a program?</h3>

A computer program means a sequence or set of instructions that is in a programming language for a computer to execute.

Here, the program based on the information given will be:

count = 0

for each v in values

if a <= v <= b

 count++

result = new int[count]

i = 0

for each v in values

if a <= v <= b

 result[i] = v

 i++

return result

Java code:

public class ArrayRange {

public static int[] allMatches(int[] values, int size, int a, int b) {

 int count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   count++;

  }

 }

 int result[] = new int[count];

 count = 0;

 for (int i = 0; i < size; i++) {

  if(values[i] >= a && values[i] <= b) {

   result[count++] = values[i];

  }

 }

 return result;

}

public static void main(String[] args) {

 int[] a = {11, 3, 9, 4, 2, 5, 4, 7, 6, 0};

 int[] returnedArray = allMatches(a, 8, 3, 7);

 for (int i = 0; i < returnedArray.length; i++) {

  System.out.print(returnedArray[i] + " "

Learn more about program on:

brainly.com/question/1538272

#SPJ1

You might be interested in
Differentiate between inherited trait and acquired trait​
miskamm [114]

Answer: Inherited trait is something you already have and acquired is something that you learn or achieve.

Explanation:

8 0
3 years ago
Indicate whether the following actions are the actions of a person who will be a victim, or will not be a victim, of phishing at
Zepler [3.9K]

Answer:

Phishing Victim

Explanation:

Replying to this email could make you a victim of a phishing scam. Phishing attacks are common challenges on security that internet users are faced with. It could lead to others getting hold of sensitive information like your password or bank details. email is one way the hackers used to get this information. replying to such an email could lead one to an unsecure website where information could be extracted

4 0
3 years ago
Why you chose BSIT?​
chubhunter [2.5K]

Answer:

Because of choice.

Explanation:

meaningful Question py

6 0
3 years ago
Read 2 more answers
Please help it would mean to world to me❤️ (WORD)
Leno4ka [110]
Its Option A - Bullets
Thank you!
6 0
3 years ago
A 40 fps(frames per second) video clip at 5 megapixels per frame would generate large amount of pixels equivalent to a speed of
777dan777 [17]

Answer:

4800\dfrac{megabytes}{second}

Explanation:

We have the next two data:

40\,\dfrac{frames}{second}

5\,\dfrac{megapixels}{frame}

Now we can find the number of megapixels per second.

40\dfrac{frames}{second}\cdot 5\dfrac{megapixels}{frame}=200\dfrac{megapixels}{second}

Finally considering an RGB video we will have 3 channels each one with 8 bytes then we will have 24 bytes per each pixel then:

3 0
3 years ago
Other questions:
  • What are the correct steps to find the system specifications such as the amount of ram or system type for windows 7 machine?
    5·1 answer
  • Which of the following enabled mass production in the 1920s? a.standardization of spare parts b.mass availability of electricity
    7·2 answers
  • Write a Bash script that searches all .c files in the current directory (and its subdirectories, recursively) for occurrences of
    14·1 answer
  • What are career resources?
    7·2 answers
  • Power brakes:
    12·2 answers
  • Jenny has to include the image of a sun on one of her slides. She needs to write relevant text about it on a dark background on
    6·1 answer
  • What is the current in a circuit that uses 120V and has 1200W of power?
    6·1 answer
  • 1.Discuss the differences and similarities between a peer-to peer network and a client server network.
    8·1 answer
  • Energy is required in order to produce any sound.<br> true<br> false
    15·2 answers
  • Write down a scratch program which:
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!