Answer to Question #122567 in Java | JSP | JSF for fady mohamed

Question #122567
Given a set of N elements that contain exactly X distinct elements (while the rest are repetitions), the redundancy ratio is defined as the ratio N/X.

You are supposed to write a program to input a set of integers, and keep track of the redundancy ratio. Once the redundancy ratio reaches or exceeds a specific value r, the program terminates and prints this ratio with a message indicating that your numbers have “many repetitions”. If you want to force the program to terminate before the redundancy ratio reaches r, you can input -1 as your input integer. In this case, the program prints the current ratio with a message indicating that your numbers have “only few repetitions”.
Input format:
First line contains the redundancy ratio r as a real number greater than 1.
Next lines contain integers one per line.
Output format:
Print the required answer. Sample input 1 1.5 1 4 2 5 2 2 Sample output 1 ratio=6/4=1.5 many repetitions
1
Expert's answer
2020-06-15T20:05:21-0400
Dear fady mohamed, your question requires a lot of work, which neither of our experts is ready to perform for free. We advise you to convert it to a fully qualified order and we will try to help you. Please click the link below to proceed: Submit order

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS