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
This type of program is designed to be transmitted over the internet and run in a web browser
vodomira [7]
This sounds like a web-based application because they are designed to be ran within a website, generally with Adobe Flash.
8 0
3 years ago
Which of the statements below explains why a budget is useful
Papessa [141]

The answer is D. All the other answers describe what a budget CAN be like, not necessarily what it is for everyone, if that makes sense.

8 0
3 years ago
Which of the following are vector graphic file formats? Choose all that apply.
ddd [48]

i need pics to see what it is



5 0
3 years ago
When installing a Windows 10 an already installed Windows 7 what happen​
astra-53 [7]

Answer:

are u updating it? or u r rooting it?

4 0
3 years ago
Read 2 more answers
What is text formatting?​
Ede4ka [16]

Answer:

Formatting text is the text that is displayed in a specified style. This refers to how text appears in your document. This includes the size, color, and font of the text.  

examples: text <em>text </em><u>text</u>

3 0
3 years ago
Read 2 more answers
Other questions:
  • A. STOP: What is a technology habit you practice today that you now realize will not help you to be successful? Explain why it’s
    10·2 answers
  • The original U.S. income tax of 1913 was quite simple. The tax was
    10·1 answer
  • Graded Assignments may be found at the end of each chapter of the required textbook under the title "Real-World Exercises". Each
    15·1 answer
  • Karen thinks she should go out with Blane, an unattractive, social misfit, because “If I don’t go out with him, people will thin
    7·1 answer
  • A(n) _____ can be used to reveal a competitor’s program code, which can then be used to develop a new program that either duplic
    9·1 answer
  • 1A network administrator notices that some newly installed Ethernet cabling is carrying corrupt and distorted data signals. The
    5·1 answer
  • "In about 100 words, discuss the technologies that Walmart’s trucking fleet might use to better manage their operations. Include
    7·1 answer
  • For a new version of processor, suppose the capacitive load remains, how much more energy will the processor consume if we incre
    12·1 answer
  • What do you understand by Multiprotocol Label Switching, how it works and is helpful in today's network scenario.
    15·1 answer
  • Be your self today!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!