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
Suppose a worker needs to process 100 items. the time to process each item is exponentially distributed with a mean of 2 minutes
stiks02 [169]
Suppose a worker nneeds to process100 items
7 0
3 years ago
Window is a very popular operating system becouse of its _ environment .​
Inga [223]
Window is a vary popular operating system because of its runtime and compatible environment .
hope it help
4 0
2 years ago
Read 2 more answers
match the type of secondary storage devices to their examples. CD, hard disk, flash memory. answer choices: magnetic storage dev
alisha [4.7K]
Hi pupil here's your answer ::


➡➡➡➡➡➡➡➡➡➡➡➡➡

Column A Column B

1》CD = Optical Storage Devices

2》Hard Disk = Magnetic Storage Device

3》Flash Memory = Solid State Storage


⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅⬅


Hope this helps. . . . . . .
3 0
2 years ago
When creating an ad, how does Greg know what it will look like to his potential customers?
gladu [14]

Answer:

Greg can see previews of his ad in the Preview tab of his Google My Business account.

Google My Business is a free tool for businesses to manage their online existence across Google including Search and Maps. It also provides them to edit their business information which helps customers to find their business. They can also find how many customers searched for their business.

So once Greg's ad has been officially accepted, he can enter the specific keywords he’s targeting to have a generic view  of the ad in the browser. Google gives examples of desktop ads using the keywords selected in the campaign to make a general preview.  As Greg types his URL, headline, and description, a generic preview of mobile and desktop versions of his ad will show up.

3 0
3 years ago
NEEDED ASAP
kogti [31]

Explanation:

1. special key combination that causes specific commands to be executed typically shortcut keys combine the ctrl or alt keys with some other keys.

2. 5 example of shortcut keys are:-

  • 1. ctrl + A - select all
  • 2.ctrl + B - bold
  • 3. ctrl + C - copy
  • 4. ctrl + U - under line
  • 5. ctrl + v - paste

3. (i) open the start menu

(ii) open Windows task manager

(iii) close the currently active program

(iv) replace

(v) align center

4. the three importance of shortcut keys are :

  • efficient and time saving :- using shortcut make you more efficient at doing certain task on your computer .
  • multi-tasking :- being a multi Tasker is something required in life.
  • health benefit :- cutting down on your mouse usage by using keyboard shortcut can help reduce the risk of RSI (Repetitive Syndrome Injury).

5. shortcut keys are very helpful because it take less time. keyboard shortcuts are generally used to expedite common operation by reducing input sequence to a few keystrokes.

8 0
2 years ago
Other questions:
  • The _____ contains a series of sections designed to prepare students for the ACT
    14·2 answers
  • What action makes RAM on your computer disappear?
    12·2 answers
  • Computer programmers often use binary codes (strings of 1s and 0s) to write programs for computers. These codes are then changed
    6·1 answer
  • In this mode, your presentation will fill up the entire screen. Auto Default Standard Window
    6·2 answers
  • A defensive driver's priority is __<br> A. efficiency<br> B. speed<br> C. handling<br> D. safety
    9·2 answers
  • Accepting criticism is a trait of what people?
    5·1 answer
  • Who invented the speaker?
    14·2 answers
  • Which tab is the "page break" command found on? (there are two!) *
    5·1 answer
  • The readline method of bufferedreader returns _____ when end of file is reached.
    12·1 answer
  • Looking for similarities between concepts or problems is referred to as
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!