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
makvit [3.9K]
2 years ago
14

Adam is so good at playing arcade games that he will win at every game he plays. One fine day as he was walking on the street, h

e discovers an arcade store that pays real cash for every game that the player wins - however, the store will only pay out once per game. The store has some games for which they will pay winners, and each game has its own completion time and payout rate. Thrilled at the prospect of earning money for his talent, Adam walked into the store only to realize that the store closes in 2 hours (exactly 120 minutes). Knowing that he cannot play all the games in that time, he decides to pick the games that maximize his earnings
Sample game board at the arcade GAME COMPLETION TIME (in minutes) PAYOUT RATE Pac-man 90 400 Mortal Kombat 10 30 Super Tetris 25 100 Pump it Up 10 40 Street Fighter II 90 450 Speed Racer 10 40
An acceptable solution is the one where it still picks the best earnings even when the list of games or completion times or payout rates change.
Question:
Write code in Java/Scala/Python to help Adam pick the sequence(s) of games that earn him the most money?.
Then, assume you have a variable list of games and their payout rates. What is the best way to pick the games that earn you the most?
Input Explanation
The first line of input is always an integer denoting many lines to read after the first line. In our sample test case, we have 6 in the first line and 6 lines after the first line, each having a game, completion_time and payout_rate.
In each data line, the game, completion_time and payout_rate are separated by a ','(comma).
The games board may change but the store still closes in 120 minutes.
Input
6
Pac-man,80,400
Mortal Kombat,10,30
Super Tetris,25,100
Pump it Up,10,40
Street Fighter II,90,450
Speed Racer,10,40
Output Explanation
Print the game names that earn him the most into the standard output in alphabetical order
Output
Mortal Kombat
Pump it Up
Speed Racer
Street Fighter II
Computers and Technology
1 answer:
ohaa [14]2 years ago
3 0

Answer:

ask it to ur teacher boiiiiii

You might be interested in
What is one advantage and disadvantage of designing a support security that might be based on a centralized model, where all sen
defon

Co-Ordination Difficulty: ...
Waste of Resources: ...
Larger Interests of the Enterprise Neglected: ...
Emergency Decision not Possible: ...
Lack of Qualified Managers: ...
Certain Activities Decentralization not Possible:
8 0
2 years ago
What describes a group of cells?<br> O crowd<br> Orange<br> O set<br> gangle
deff fn [24]

Answer:

A crowd because it makes more sense tho i could be wrong

7 0
2 years ago
Read 2 more answers
Describing Work Styles for Farmworkers and Laborers, Crop
Olegator [25]

Answer:

it is A,B,E,F,G

Explanation:

can i have brainliest please.

7 0
2 years ago
Read 2 more answers
The OSI model is a useful tool in troubleshooting a network because it enables you to isolate a problem to a particular software
lutik1710 [3]

Answer:

1)  Layer 4, transport

2) Layer 2, datalink

3) Layer 5, session

4) Layer 7, application

Description of Problems are as below:

1) One of your servers has been exhibiting sluggish network performance. you use a network-monitoring program to try to evaluate the problem. You find considerable TCP retries occurring because the server is being overwhelmed by data, and packets are being discarded.

2) You check some statistics generated by a network-monitoring program and discovers that an abnormally high number of CRC errors were detected. (Hint think of the cause of CRC errors).

3) A user is trying to connect to another computer, but the logon attempt is continually rejected.

4) You try to access a Linux server to share files by using NFS. You can communicate with the server, but the shared files don't appear to be available.

Explanation:

OSI Model is a reference model to determine how applications communicate over a network. OSI consists of seven layers, and each layer performs a particular network function. The seven layers are:

   Layer 7 - Application.

   Layer 6 - Presentation.

   Layer 5 - Session.

   Layer 4 - Transport.

   Layer 3 - Network.

   Layer 2 - Data Link.

   Layer 1 - Physical.

1) One of your servers has been exhibiting sluggish network performance. you use a network-monitoring program to try to evaluate the problem. You find considerable TCP retries occurring because the server is being overwhelmed by data, and packets are being discarded.

Layer 4, transport

2) You check some statistics generated by a network-monitoring program and discovers that an abnormally high number of CRC errors were detected. (Hint think of the cause of CRC errors).

Layer 2, Data Link

3) A user is trying to connect to another computer, but the logon attempt is continually rejected.

Layer 5, session

4) You try to access a Linux server to share files by using NFS. You can communicate with the server, but the shared files don't appear to be available.

Layer 7, application

7 0
3 years ago
Which number is the decimal equivalent of 1100110 – 101101?
erastovalidia [21]

1100110-101101 = 111001 = 57

3 0
3 years ago
Read 2 more answers
Other questions:
  • The spreadsheet below shows the names years in office, and number of terms for five US presidents
    7·2 answers
  • Randy is concerned about his company’s data security on the Internet. Because cellular signals are not encrypted, he is concerne
    6·1 answer
  • A company decides to reduce its IT labor force by hiring an external company to manage various aspects of IT administration, suc
    6·1 answer
  • Whos ready for sao ordinal scale this march!!!( ಥـْـِـِـِـْಥ)
    7·1 answer
  • Janis is preparing a financial document. She needs to use the dollar symbol placed above the number key 4. Which key will Janis
    12·2 answers
  • What is a GUI?
    11·1 answer
  • A benefit of flashcards is that they are
    7·2 answers
  • What are expansion cards used for?​
    9·2 answers
  • What are 3 important reasons to reconcile bank and credit card accounts at set dates?
    15·1 answer
  • Consider that a man is watching a picture of a Black Horse. He receives an external stimulus from input channel. Man gains some
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!