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]
3 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]3 years ago
3 0

Answer:

ask it to ur teacher boiiiiii

You might be interested in
What effect did personal computers and internet have on how people acces information
Ganezh [65]
Personal computers made accessing information a lot faster and easier but a lot of times the things we see when we search information is tailored to our personal beliefs and opinions. For example, if you're a person that commonly searches for information or products about dogs, you're way less likely to get an add promoting cat food. While this may seem like a very positive thing, it also may have a downside. This rule also applies to things like political views, if you're a trump supporter you'll most likely end up seeing things that are pro-Trump and a lot fewer things that are pro-Hilary. 

This can skew people's outlooks on certain subjects, if you're only ever seeing web pages and articles saying that Trump is great, you won't ever see the opposing side which is essential in making a well-informed decision about a candidate for the presidency or any other subject for that matter.

In summary, You have to see both the good and bad side of something to truly make a choice and the way the internet works can sometimes make that difficult.


I hope this helps and makes sense! :)
6 0
3 years ago
Read 2 more answers
This operating system was used by individual computers an required users to type commands
nika2105 [10]
Hey there!

The operating system that functions from typing commands is called a Command–Line–Based OS. Examples of this type of OS include UNIX and MS–DOS made by Microsoft. These features white or green text on a black screen and were primarily meant for professionals who had to learn lots of commands rather than everyday users. 

Hope this helped you out! :-)
7 0
3 years ago
_____ are the supertiny on-off switches in a chip that work collectively to calculate or store things in memory. Transistors Mul
Pepsi [2]

Answer:

Transistors

Explanation:

4 0
3 years ago
When Creating a game ( Which I Am, FPS ofc ) what are the basic rules would you want to add
Gnesinka [82]

Answer:

2 ig

Explanation:

5 0
3 years ago
When LDAP traffic is made secure by using Secure Sockets Layer (SSL) or Transport Layer Security (TLS), what is this process cal
Simora [160]

Answer:

Authorization is granting permission for admittance. ACLs provide file system security for protecting files managed by the user. Rule-Based Access Control can be changed by users.

Explanation:

8 0
2 years ago
Other questions:
  • PLEASE HURRY
    6·1 answer
  • . Given an initially empty stack s that accepts integers, the following operations are performed: s.push (10) s.push (20) s.push
    13·1 answer
  • how to make assignment on power point plz cntct me and help me all about power point and my assignment is prime ministers of pak
    13·1 answer
  • Diane is receiving a lot of unwanted e-mail. What steps can she take to reduce the amount of e-mail she receives?
    12·1 answer
  • Please help with the question no. 5 and 7 please help ​
    6·1 answer
  • Your organization uses a type of cryptography that provides good security but uses smaller key sizes and utilizes logarithms tha
    9·1 answer
  • What is the HCF of smallest prime number and the smallest composite number?​
    12·1 answer
  • Write a program that accepts the lengths of three sides of a triangle as an input from the user: A, B, C
    13·1 answer
  • Excerpt from "How Prepared Are Students for College Level Reading? Applying a Lexile-Based Approach."
    6·1 answer
  • How would you assign roles to your group members?
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!