Write a method called removeHighPrice that will go through a provided ArrayList called prices and removes the first price that is more than $5.00 and return the new ArrayList. If a price over $5 is not found, it returns the original ArrayList.

Answers

Answer 1

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);  

 }

I've added as an attachment, the complete program which includes the main method


Related Questions

HELLLLLLLLLLLLLLLLLLLLP PLSSSSSSSSSSS HELLLLLLLLLP
Which of the following is an example of a Boolean Operator?
A. HTML
B. SEO
C.
D. BUT

c is
TITLE

Answers

Answer:

HTML?

Explanation:

That looks like the best answer, correct me if I'm wrong ^^U

in which genre of games do players most often have the power to shape how the story will end?

platformer games
shooter games
role-playing games
puzzle games

Answers

Role playgames are the most customizable

Answer:

role-playing games

Explanation:

The table button is present in the ……… tab.​

Answers

Answer:

Insert

Explanation:

The table button is present in the Insert tab.​

Refer to screenshot (MS Word)

Insert → Table → Insert Table or Draw Table

Does magnetic tape require a laser to read data?

Answers

Answer:

No the magnetic tape requires a tape drive mechanism

Explanation:

The data in magnetic tape consists of information that has been digitized into discrete numbers by means of of a recording device which can also be able to read the recorded data on the tapes

As the magnetized tape passes under a current carrying conductor, the data on the magnetized surface can be sensed

Due to the arrangement of the magnetic tapes in their stored format, the process of retrieving information makes use of serial access such that information retrieval is slow.

Which of the following will be output data type of int +int ?

Answers

Answer:

int data type

Explanation:

Given

int + int

Required

Determine the data type of the output

I'll answer this question with the following illustration.

int x = 1

int y = 2

print(x + y)

At line 3, 1 and 2 will be added together.

[tex]1 + 2 = 3[/tex]

And 3 will be printed as integer.

Because 1 and 2 are of type integer.

Hence, when two or more integer variable are added together, the result is also an integer.

Formula for adding values of cells A9 to A15 is
Please answer fast

Answers

Answer:

This is my opinion. ^_^

You need to sum a column or row of numbers, let Excel do the math for you. Select a cell next to the numbers you want to sum, click AutoSum on the Home tab, press Enter, and you're done. When you click AutoSum, Excel automatically enters a formula (that uses the SUM function) to sum the numbers.

The formula to add the values of the cell A9 to A15 is =SUM(A9:A15)

What is a cell in excel?

Cells are the boxes that appear in the grid of an Excel worksheet such as this one. On a worksheet, each cell is identified by its reference, the column letter and row number that intersect at the cell's location.

This cell is in column D and row 5, so it is designated as cell D5. In a cell reference, the column always comes first.

The formula combines values from 9 to 15 columns or rows.

The Sum keyword is used to add any number of values together and calculate their total.

The ":" symbol indicates the range that must be added together. Another method of adding is to simply select the values to be added and then select auto sum- then sum.

Thus, =SUM(A9:A15) is the formula for adding values of cells A9 to A15.

For more details regarding excel, visit:

https://brainly.com/question/3441128

#SPJ6

Which step in the software development life cycle involves making improvements based on user feedback?
Coding
Design
Maintenance
Testing

Answers

Answer:

The step is Testing oki doki

Answer:

Maintenance

Explanation:

Maintenance

This primarily involves updating and making improvements based on user feedback, as well as resolving any defects that are found.

HELLLLLLLLPPPPPPPPPPPP HHHHHHHHHEEEEEEEEELLLLLLPPPPPP MEEEEEEEE
"What is the capital of Belarus?" is an example of what type of search query?
A. Boolean operator
B. HTML markup language
C. Natural language
D. Keyword phrase

Answers

Answer:

C. Natural language

Explanation:

this is because the search query uses normal letters and phrases without attaching codes

Natural language is the capital of Belarus.

What is Capital of Belarus?

As the nation's capital, Minsk enjoys exceptional administrative privileges and serves as the hub for both Minsk District and Minsk Region. With a population of 2 million as of January 2021, Minsk was the eleventh most populous city in Europe.

One of the administrative capitals of the Eurasian Economic Union (EAEU) and the Commonwealth of Independent States (CIS) is Minsk.

Minsk was first recorded in 1067 and later served as the principality's capital until it was captured by the Grand Duchy of Lithuania in 1242.

Therefore, Natural language is the capital of Belarus.

To learn more about Natural language, refer to the link:

https://brainly.com/question/12093401

#SPJ5

Which is an example of emoticon use?
A. Putting text in capital letters
O B. Including a smiley face in a text
C. Adding "xo" to show a hug and kiss
D. Creating an acronym for a phrase

Answers

I think it’d be answer B
(I do psychology and it’s kind of similar to this)

how please help me computer​

Answers

Answer:

Whaaaaaaaaaaatttttttttttttttt the

Explanation:

In a large kitchen what is meant by the partie system? Who devised this system?

Answers

Answer:

While at the Savoy in London, Escoffier formally introduced his army-influenced organisational method to the kitchens there. It became known as the Chef de partie system, and the idea was to avoid duplication of tasks, and to make communication between the various staff members easier.

7.
A videographer wants a fast computer to use to edit video files. What does this customer need to
consider when selecting RAM?

Answers

Answer:

16GB RAM

Explanation:

full from of Internet​

Answers

Answer:

inter connected network

explain Text align , Text Decoration, colour, Text shadow..​

Answers

Answer:

Text align, text decoration and text shadow are all some of the important features in CSS.

Explanation:

CSS is a programming language. It stands for Cascading Style Sheets. It is the style sheet language that is used for describing a presentation of any document that is basically written in HTML.

Text Align : This property allows the horizontal alignment of a text in an element. A text can be right align, left align, justified or centered.

Text Decoration : The text decoration features in CSS helps to set or helps to remove the decorations from the text. These are drawn across the descendant text elements.

Text shadow : This property simply allow us to add or put a shadow to the text.

What would be some reasons to change the default page
encoding?

Answers

Answer:

Synchronization with the document for one reason or another

A new user needs access to their files in iCloud without relying on the operating system (OS). How would the user access the Apple iCloud files directly online from a Mac computer running OS X?

Answers

Answer:

Log in to iCloud.com on a browser

Explanation:

On your browser which should be a supported browser, you should log in to iCloud.com since iCloud is not supported on mac OS X earlier than mac OS X Lion 10.7.5

Cheri's teacher asked her to write a program using the input() function. What will this allow her program to do?

Answers

Answer:

See explanation

Explanation:

Irrespective of the programming language, the input() function will allow Cheri's program to be able to accept user input.

Take for instance, the programming language is python, an expample of how the input function can be used is:

userinput = input("Enter a word: ")

The above instruction will allow her program to accept a string value.

The input() function can be used alongside different variable types.

Answer:

give the other guy brainliest

Explanation:

please help please I will count your answer brainiest if you help!
In what ways are math and computer science similar? How are they different?

Answers

Answer:

Without mathematics, computer science would not exist. Computers use algorithms to obtain certain information, and output certain information. Linear equations and algebra are used to create gaming graphics.

Have you ever wondered how your online quizzes were made? Inside the online quizzes there is code behind it, this code uses variables, integers, and booleans.

Variables use equations like x and y to find sum. A boolean is a basic algebraic notation, it's a binary variable.

Everything uses math, nothing would exist without math, including even digging dirt.

want some points you get some also stay away from people

Answers

Answer:

lol

Explanation:

thank YOUUUUUUUuuuuuuu

What steps will change an existing macro? Use the drop-down menu to complete the steps.
1. Go to the
tab on the ribbon.
2. In the Macros group, click
3. Click
, which will open the VBA editor.
4. Find and change the code and Save and Close.

Answers

Answer:

1. View

2. View macros

3. Edit

Explanation: completed on edge

in Kakegurui at the end of the what happens

Answers

Answer:

ok

Explanation:

မင်းငါ့ကိုငိုနေတာကိုမလိုချင်တဲ့လူငယ်များရဲ့ဆူနာမီကိုမကြည့်ချင်ဘူး

Answer:

me tiamo kisses me ddeee

Explanation:

Who finds the exact web server that hosted the website by looking in a huge database of internet addresses

Answers

Answer:

The ISP - Internet service provider

Explanation:

The internet service provider ISP finds the exact web server that hosted the website by looking in a huge database of internet addresses.

An internet service provider (ISP) is a company that provides internet connection and services to individuals and organizations.

PLEASE HURRY!!!
Wyatt has a database to keep track of an enormous collection of videos. How can Wyatt find the record for the game Lost on Mars?
a)sort the data
b)filter the data
c)query the data
d)edit the data

Answers

Answer:

Wyatt could sort the data by month

Explanation:

what is the size of 4th generation of computer and what language does they use?​

Answers

Answer:

Computers of fourth generation used Very Large Scale Integrated (VLSI) circuits. VLSI circuits having about 5000 transistors and other circuit elements with their associated circuits on a single chip made it possible to have microcomputers of fourth generation.

Fourth-generation language (4GL), Fourth-generation computer programming language

(brainliest please)

Explanation:

The period of fourth generation was from 1971-1980. Computers of fourth generation used Very Large Scale Integrated (VLSI) circuits. VLSI circuits having about 5000 transistors and other circuit elements with their associated circuits on a single chip made it possible to have microcomputers of fourth generation.

Fourth generation computers became more powerful, compact, reliable, and affordable. As a result, it gave rise to Personal Computer (PC) revolution. In this generation, time sharing, real time networks, distributed operating system were used. All the high-level languages like C, C++, DBASE etc., were used in this generation.

Fourth Generation

The main features of fourth generation are −

VLSI technology used

Very cheap

Portable and reliable

Use of PCs

Very small size

Pipeline processing

No AC required

Concept of internet was introduced

Great developments in the fields of networks

Computers became easily available

Some computers of this generation were −

DEC 10

STAR 1000

PDP 11

CRAY-1(Super Computer)

CRAY-X-MP(Super Computer)

SOMEONE PLEASE HELP ME PLEASE!!!!!

Answers

Answer:

The last one.

Explanation:

Figure out how to improve the fuel efficiency of planes.

Explanation:

How many different messages can I convey if I use 2 light bulbs and each one stays either on or off?
4
3
6
2

Answers

3 I just did this ykkk

Answer:

4

Explanation:

1st: on on

2nd: on off

3rd: off on

4th: off off

Nadia has inserted an image into a Word document and now would like to resize the image to fit the document better.

What is the quickest way to do this?

keyboard shortcut
sizing handles
context menu
sizing dialog box

Answers

Sizing handles but I’m not super sure

HELP ME PLEASE !!!!!!!!!!

Answers

Answer:

the last one

Explanation:

This question involves a simulation of a two-player game. In the game, two simulated players each start out with an equal number of coins. In each round, each player chooses to spend either 1, 2, or 3 coins. Coins are then awarded to each player according to the following rules.

Same rule: If both players spend the same number of coins, player 2 gains 1 coin.
Off-by-one rule: If the players do not spend the same number of coins and the positive difference between the number of coins spent by the two players is 1, player 2 is awarded 1 coin.
Off-by-two rule: If the players do not spend the same number of coins and the positive difference between the number of coins spent by the two players is 2, player 1 is awarded 2 coins.

The game ends when the specified number of rounds have been played or when a player’s coin count is less than 3 at the end of a round.

The CoinGame class is shown below. You will write two methods in the CoinGame class.

public class CoinGame

{

private int startingCoins; // starting number of coins

private int maxRounds; // maximum number of rounds played



public CoinGame(int s, int r)

{

startingCoins = s;

maxRounds = r;

}



/** Returns the number of coins (1, 2, or 3) that player 1 will spend.

*/

public int getPlayer1Move()

{

/* implementation not shown. */

}



/** Returns the number of coins (1, 2, or 3) that player 2 will spend, as described in part (a).

*/

public int getPlayer2Move(int round)

{

/* to be implemented in part (a) */

}



/** Plays a simulated game between two players, as described in part (b).

*/

public void playGame()

{

/* to be implemented in part (b) */

}

}

In the simulation, player 2 will always play according to the same strategy. The number of coins player 2 spends is based on what round it is, as described below.

(a) You will write method getPlayer2Move, which returns the number of coins that player 2 will spend in a given round of the game. In the first round of the game, the parameter round has the value 1, in the second round of the game, it has the value 2, and so on. The method returns 1, 2, or 3 based on the following rules.

If round is divisible by 3, then return 3.
If round is not divisible by 3 but is divisible by 2, then return 2.
If round is not divisible by 3 and is not divisible by 2, then return 1.
Complete method getPlayer2Move below by assigning the correct value to result to be returned.

/** Returns the number of coins (1, 2, or 3) that player 2 will spend, as described in part (a).

*/

public int getPlayer2Move(int round)

{

int result;

return result;

}

Write the method playGame, which simulates a game between player 1 and player 2, based on the rules and example shown at the beginning of the question. Both player 1 and player 2 start the game with startingCoins coins. Computer player 1 spends 1, 2, or 3 coins based on the value returned by the method getPlayer1Move(). Computer player 2 spends 1, 2, or 3 coins based on the value returned by the method getPlayer2Move().

The game ends when maxRounds rounds have been played or when a player’s coin count is less than 3 at the end of a round.

At the end of the game, the winner is determined according to the following rules.

If both players have the same number of coins at the end of the game, the method prints "tie game".
If player 1 has more coins than player 2, the method prints "player 1 wins".
If player 2 has more coins than player 1, the method prints "player 2 wins".
(b) Assume that getPlayer2Move works as specified, regardless of what you wrote in part (a) . You must use getPlayer1Move and getPlayer2Move appropriately to receive full credit.

Complete method playGame below.

/** Plays a simulated game between two players, as described in part (b).

*/

public void playGame()

Answers

[A] Let's simplify the getPlayer2Move rules first.

If round is divisible by 3, then return 3

if a number is divisible by another number that means the remainder of the division is 0. We can write the code as follows:

if (round%3 == 0)

result = 3;

If round is not divisible by 3 but is divisible by 2, then return 2.

Same as the previous one, we are going to use the remainder operation. We can use an else-if condition here.

else if (round%2 == 0)

result = 2;

If round is not divisible by 3 and is not divisible by 2, then return 1.

An else would work fine here.

else

result = 1;

The full code of part A is attached below.

[B]

playGame method:

Let's have a quick look at the game rules first:

If both players spend the same number of coins, player 2 gains 1 coin.

This can be translated to if player1Spending == player2Spending, then player2 gets a coin.

If the players do not spend the same number of coins and the positive difference between the number of coins spent by the two players is 1, player 2 is awarded 1 coin.

If the absolute value of (player1Spending - player2Spending == 1) then player2 gets awarded.

If the players do not spend the same number of coins and the positive difference between the number of coins spent by the two players is 2, player 1 is awarded 2 coins.

We can either use an else statement or a separate conditional statement here, but I'll go for the else statement.

We can use a while loop to detect when the game ends, either a player's coins is less than 3 OR when the maxRounds have been played.

Which of the following types of copyright license is most appropriate if you create a graphic and would like to share it with anyone for any purpose as long as you receive credit?
A. All Rights Reserved
B. Public Domain
C. Some Rights Reserved: Attribution
D. Some Rights Reserved: Share Alike

Can someone help me out with this? Thanks!

Answers

Answer:

C is the correct answer:)

Explanation:

The most appropriate type of copyright license for the described scenario would be Some Rights Reserved: Attribution. The correct option is C.

What is copyright license?

A copyright license is a legal agreement between the copyright holder and someone who wants to use the copyrighted material.

This licence allows others to use and distribute the graphic as long as the original creator is credited. It is a type of Creative Commons licence in which some rights are granted to others while others are reserved for the original creator.

This option is ideal if you want to share your work with others while maintaining control and receiving credit for it.

Option B, Public Domain, allows anyone to use the graphic for any purpose without attribution, whereas Option D, Some Rights Reserved: Share Alike, requires others to share derivative works under the same licence terms.

Option A, All Rights Reserved, would prohibit others from using the graphic without the creator's explicit permission.

Thus, the correct option is C.

For more details regarding copyright license, visit:

https://brainly.com/question/30696317

#SPJ2

Other Questions
A(n) _____ market is a market in which just a few firms control a large market share. a. monopolistic b. monopsonistic c. monopolistically d. competitive e. oligopolistic Please answer ASAP will mark brainliest. If a reflection leaves a point unchanged, which of the following mustbe true (select all that apply):1 The line of reflection must have a slope of 0.2. The point must be the origin.3. The line of reflection has a slope of 1.4. The point lies on the line of reflection. If a borrower can afford to make monthly principal and interest payments of 1000 and the lender will make a 30 year loan at 5 1/2%, or a 20 year loan at 4 1/2% what is the largest loan this buyer can afford 9. The triceps are located on the back of the arm. (5 points)O trueO false If you were a Paleolithic person faced with the decision to switch from hunting and gathering to agriculture or to keep your nomadic ways, which would you choose Complete an error analysis for each of the questions below. find an equation in standard form of the parabola passing through the points (0, - 1), (1, 5), (- 1, - 5) food and electricity are the examples of_________________ Chang knows one side of a triangle is 13 cm. Which set of two sides is possible for the lengths of the other two sidesof this triangle?5 cm and 8 cmo 6 cm and 7cm0 7 cm and 2 cm8 cm and 9 cm Which ONE of the following was NOT a part of the Compromise of 1850?A. The fugitive Slave Law was passed. B. Slave trading was ended in the District of Columbia.C. California was admitted as a slave state. D. California was admitted as a free state. Pls help. Take a pic of your work on paper thanks. I'll cashapp you 10$ What are some of the ways we can resolve IPv4 address shortages? Check all that apply. help please, question 11 ........ The length of a rectangle is three less than four times the width. The perimeter of the rectangle is 54 feet. Find the width of the rectangle. The first ten amendments to the Constitution, known as the Bill of Rights, were adopted in 1791. This was four yearsafter the original Constitution had been written, and two years after it had been adopted and George Washington hadbecome president. The Bill of Rights guaranteed that the central government would not take away the rights andfreedoms of the people.Decide which one of the ten amendments in the Bill of Rights gave people each of the rights and freedoms in thefollowing list. Fill in the space with the number of the amendment. Some numbers will be used more than once.1. _____ the right not to be put on trial twice for the same crime2. _____ freedom of assembly3. _____ the right to be tried in the state and district where the crime occurred4. _____ no quartering of soldiers in homes without the approval of the owner5. _____ freedom of the press6. _____ the right to have guns7. _____ the right to a public trial8. _____ the right to know the witnesses against oneself9. _____ freedom of speech10. _____ the right to have a lawyer11. _____ the right not to testify against oneself12. _____ the right not to lose life, liberty, or property without due process of law13. _____ the right to be tried soon after being accused of a crime14. _____ freedom of religion15. _____ the right to know the charges on which one is being held16. _____ you have "implied" rights, not specifically listed in the Constitution17. _____ the right to a jury in a civil case18. _____ freedom from unreasonable search and seizure19. _____ the right to be paid for private property taken for public use20. _____ the right to obtain witnesses in ones defense21. _____ freedom to petition the government to correct grievances22. _____ no cruel or unusual punishments23. _____ no excessive bail or fines What is the approximate difference in the number of immigrants from 1940's to the 2000's? A soccer field has a width of x and a length of x + 40. If the perimeter of the field is 240 yards. Write and solve an equation for the given scenario to find the length and width of the field. I will give brainlist if you give me step by step Please helpMe I beg you please I will give you credit please 14)Work with the president to run the executivebranch.