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
lidiya [134]
3 years ago
6

Write a method called removeHighPrice that will go through a provided ArrayList called prices and removes the first price that i

s more than $5.00 and return the new ArrayList. If a price over $5 is not found, it returns the original ArrayList.
Computers and Technology
1 answer:
Diano4ka-milaya [45]3 years ago
6 0

Answer:

The method written in Java is as follows:

public static ArrayList<Double> removeHighPrice (ArrayList<Double> prices){

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

     if(prices.get(i) > 5.00){

         prices.remove(i);  

         break;

     }

 }

 return(prices);  

 }

Explanation:

This line declares the method

public static ArrayList<Double> removeHighPrice (ArrayList<Double> prices){

This line iterates through the ArrayList named prices

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

This checks if current price is greater than 5

     if(prices.get(i) > 5.00){

If yes, the price is removed

         prices.remove(i);  

And the loop is terminated

         break;

     }

 }

This returns the ArrayList

 return(prices);  

 }

<em>I've added as an attachment, the complete program which includes the main method</em>

Download txt
You might be interested in
Imagine that you work for a company directly related to your major. Your company is preparing for expansion and your boss, Ms. S
shutvik [7]

Answer:

start with what you know

Explanation:

6 0
3 years ago
Text line breaks and returns are controlled using which tags?
eduard
<b></b> <span>element when used to strongly emphasize portions of text within a document.
<p></p> </span><span>tag defines a paragraph.
<ol></ol> </span><span>Defines an ordered list
<a></a> </span><span> tag defines a hyperlink</span>
5 0
3 years ago
Read 2 more answers
If cos 3/5 what is the sin and tan​
suter [353]

Answer:2.988584094

Explanation:

6 0
3 years ago
You are a network consultant who has been asked to attend an initial meeting with the executive management team of ElectroMyCycl
Snezhnost [94]

Answer:

ElectroMyCycle, LLC.

The research I will do before my initial meeting with the executive management team will be to find out the following:

4. Client’s suppliers and customers

5. Products and services offered

Explanation:

My research will concentrate on the types of products and services  that ElectroMyCycle is offering its customers and raw materials that it purchases from the suppliers, because the network assets are being installed to enhance business transactions between ElectroMyCycle and its customers and suppliers.  And as the company is expanding with more suppliers and customers, more products and services, the network configuration will be built around these stakeholders.

4 0
3 years ago
Plz help code practice for python
laila [671]

Answer:umm

Explanation:

6 0
3 years ago
Read 2 more answers
Other questions:
  • The Glow effect adds a blinking border around a chart.<br> t or f
    15·1 answer
  • What do we call a subset of new media in which groups and their fans can interact directly?
    14·1 answer
  • Fill in the correct term to complete the statement. _____ refers to borrowing money from a bank.
    13·2 answers
  • Natural selection is a. how systems of rewards increase desired behaviors. b. the idea that the observable environment affects b
    6·1 answer
  • A motherboard has four DIMM slots; three slots are gray and the fourth is black. What type of memory is this board designed to u
    6·1 answer
  • Shelly tells a friend that her computer needs to be fixed because it has been producing a lot of heat and is smoking. Where is t
    10·1 answer
  • my airpods just do not seem to connect if i try to pair them, reset them, they have this continuous green light, please help me
    12·1 answer
  • Why might you complete a 1040 instead of a <br> 1040ez
    11·2 answers
  • The average number of entities completed per unit time -- the output rate -- from a process is called ____.
    9·1 answer
  • Preciso de ajudar para resolver esse exercício, é para amanhã cedo!!<br><br> Em Dev C++
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!