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
Define Rule Of Thirds
Katena32 [7]

Answer:

In photography, the rule of thirds is a type of composition in which an image is divided evenly into thirds, both horizontally and vertically, and the subject of the image is placed at the intersection of those dividing lines, or along one of the lines itself.

6 0
2 years ago
What variation pairs a new employee with an employee who has been with the company for 20 years?
Eva8 [605]

The variation pairs a new employee with an old employee usually focus on employee accomplishments, and criteria that employee meets or not.

<h3>What are the Appraisal Methods used to evaluate an employee's performance?</h3>

The behavioral method is known to be one of the ways to check an employee's actions within a given job.

Conclusively, There is also the use of Comparative methods that tends to compare one employee with different employees. The use of Results methods are the ones that looks into  employee accomplishments.

Learn more about variation pairs from

brainly.com/question/19262673

4 0
1 year ago
Read 2 more answers
Which wireless communication technology is most likely used when synchronizing device information to an automobile?
seropon [69]
Bluetooth is the most reasonable answer
8 0
3 years ago
What is the promotion and advertising stage of a product or service called?
Eddi Din [679]

Answer:

Marketing

Explanation:

8 0
3 years ago
Which statement does not describe the guidelines for the use of text in presentation programs?
olganol [36]
Choice a
have a great day

7 0
2 years ago
Other questions:
  • The _____ element, a hypertext markup language (html) metadata element, contains a collection of metadata elements that describe
    11·2 answers
  • A blank is a link on a web page that leads to another web page.
    14·1 answer
  • What are the conditions for using still photos in a video program
    6·1 answer
  • Which branch of science helps avoid or minimize stress-related injuries at workplace?
    12·2 answers
  • A parent is browsing through a shopping website, looking for blue-colored striped socks for her child. She is fine if the socks
    15·1 answer
  • 1. Accessing calendars, contact information, emails, files and folders, instant messages, presentation, and task lists over the
    7·1 answer
  • Durante 10s, la velocidad de rotación y el momento de giro de las ruedas de un coche eléctrico son 100 rpm y 1405,92 Nm, respect
    15·1 answer
  • What is targets net worth in 2020 (i will see if you put in 2019)
    11·1 answer
  • 2. The Internet could best be described as: *
    12·1 answer
  • Send link for a qc or paddle
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!