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
Irina18 [472]
2 years ago
7

JAVA

Computers and Technology
1 answer:
avanturin [10]2 years ago
3 0

Answer:

   public ArrayList onlyBlue(String[] clothes){

       ArrayList<String> blueCloths = new ArrayList<>();

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

           if(clothes[i].equalsIgnoreCase("blue")){

               blueCloths.add(clothes[i]);

           }

       }

       return blueCloths;

   }

Explanation:

  • Create the method to accept an Array object of type String representing colors with a return type of an ArrayList
  • Within the method body, create and initialize an Arraylist
  • Use a for loop to iterate the Array of cloths.
  • Use an if statement within the for loop to check if item equals blue and add to the Arraylist.
  • Finally return the arrayList to the caller
You might be interested in
Which of the following is true about occupations within the STEM fields? Many occupations use mathematics, even if it is not the
Kazeer [188]

Answer:

Many occupations use mathematics, even if it is not the primary focus of a given job.

Explanation:

Think about software developers, they develop apps, websites, and other things, but they also use math in the process. Scientists use statistics. Mechanics use math to make sure their measurements are right. Therefore, I think your best bet would be

A. Many occupations use mathematics, even if it not the primary focus of a given job.

8 0
3 years ago
Read 2 more answers
To make a profit the price of the items sold in the furniture store are marked up by 80 %after marking up the prices each item i
Verdich [7]

Answer:

The algorithm is as follows:

1. Start

2. Display "Input Item Price: "

3. Input Price

4. Markup = Price + 80% * Price

5. Selling_Price = 10% * Markup

6. Display "The Selling Price is "+Selling_Price

7. Stop

Explanation:

This signals the beginning of the algorithm

1. Start

This is a prompt that asks for the price of the item

2. Display "Input Item Price: "

This gets the price of the item

3. Input Price

This calculates the Markup (80% of the inputted price)

4. Markup = Price + 80% * Price

This calculates the selling price (10% of the markup)

5. Selling_Price = 10% * Markup

This prints the selling price

6. Display "The Selling Price is "+Selling_Price

This signals the end of the algorithm

7. Stop

7 0
2 years ago
¿Cuál crees tú sea la finalidad de los virus informático, y porque son creados? ¿Cuáles son las precauciones y / o recomendacion
pantera1 [17]

Un virus informático es un tipo de programa de software malicioso ("malware") que, cuando se ejecuta, se replica modificando otros programas informáticos e insertando su propio código. Cuando esta replicación tiene éxito, se dice que las áreas afectadas están "infectadas" con un virus informático.

Un virus informático es un tipo de programa de software malicioso ("malware") que, cuando se ejecuta, se replica modificando otros programas informáticos e insertando su propio código. Cuando esta replicación tiene éxito, se dice que las áreas afectadas están "infectadas" con un virus informático.

lo mejor es mantener tu computadora actualizada

6 0
3 years ago
Double any element's value that is less than controlValue. Ex: If controlValue = 10, then dataPoints = {2, 12, 9, 20} becomes {4
Aleksandr [31]

Answer:

import java.util.Scanner;

public class StudentScores

{

public static void main(String[] args) {

 Scanner scnr = new Scanner(System.in);

 final int NUM_POINTS = 4;

 int[] dataPoints = new int[NUM_POINTS];

 int controlValue;

 int i;

 controlValue = scnr.nextInt();

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

     dataPoints[i] = scnr.nextInt();

 }

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

     System.out.print(dataPoints[i] + " ");

 }

 System.out.println();

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

     if(dataPoints[i] < controlValue){

         dataPoints[i] = dataPoints[i] * 2;          

     }

     System.out.print(dataPoints[i] + " ");

 }

}

}

Explanation:

*Added parts highligted.

After getting the control value and values for the array, you printed them.

Create a for loop that iterates through the dataPoints. Inside the loop, check if a value in dataPoints is smaller than the contorolValue. If it is, multiply that value with 2 and assign it to the dataPoints array. Print the elements of the dataPoints

5 0
3 years ago
Read 2 more answers
How much cell phone data does the average person use a month
azamat
It all depends on what you're doing online.
7 0
2 years ago
Other questions:
  • The groups_per_user function receives a dictionary, which contains group names with the list of users. Users can belong to multi
    11·1 answer
  • _____ create computer programs by using their knowledge of computer science, math, and other disciplines.
    11·1 answer
  • What is the voltage drop across R4 in the diagram shown above?
    13·1 answer
  • A user prefers an external monitor, mouse, and keyboard for a laptop. The user does not want to use the built-in screen; however
    5·1 answer
  • You can combine the algorithms for converting between infix to postfix and for evaluating postfix to evaluate an infix expressio
    13·1 answer
  • The IP protocol (and UDP) are called "connectionless" and "unreliable." Describe what those two words mean in the context of dat
    8·1 answer
  • Alan has introduced a new line of scooters on his website and is using a Google Display Ad campaign to promote them. He selects
    8·1 answer
  • JPG is considered a lossy file format. What does this mean?
    15·2 answers
  • You are the system administrator for Precision Accounting Services, which employs 20 accountants and 25 accounting assistants. T
    13·1 answer
  • How to give a file name as an argument in function in python.
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!