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
Help me find the right answer please.
timama [110]

Answer:

I'm not sure

Explanation:

I'm good at math but I do not see any numbers to work with. SORRY

5 0
2 years ago
This question involves the app Messenger the blue thing that can be synced with Facebook. So my friend took a picture of my code
jarptica [38.1K]
He probably hasn't sent the request or you haven't updated it or he is not part of your Facebook  contac list
7 0
2 years ago
In which job role would a course in 3D modeling help with professional career prospects?
shutvik [7]
The correct answer would be a Multimedia Artist, seeing that you will be designing various models for animations, computer games, etc.
5 0
3 years ago
Read 2 more answers
Read what is in the commets.
yKpoI14uk [10]

Answer:

I'm a little confused on what you are asking, could you please explain.

5 0
2 years ago
Why should you delete files from your computer
notka56 [123]

deleting files can free up space and prevent hackers from accessing your sensitive files

5 0
1 year ago
Read 2 more answers
Other questions:
  • Which of the following is an example of new and emerging classes of software?
    11·1 answer
  • The company currently runs 60 autonomous APs and has plans to increase wireless density by 50% in the near future
    13·1 answer
  • QUESTION
    10·1 answer
  • Explain briefly why every person in the world is not connected to the Internet.
    9·1 answer
  • Which cell address indicates the intersection of the first row and the first column in worksheet?
    12·2 answers
  • Ben pays his mobile bills, watches movies, and shops online using the Internet. Which internet activity does he perform?
    13·2 answers
  • Assume n represents the number of inputs. The possible number of states within a truth table can be calculated using which of th
    10·1 answer
  • First person to answer gets free brainlist
    15·2 answers
  • Um i'm new here... and i don't know really how to use this... i was wondering if som 1 can help me
    6·2 answers
  • How does naming affect a variable’s creation and use?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!