=100) distinct integers in unsorted order, write a C or C++ or Javaprogram to find the integer in the list that is greater than exactly 43% of the integers in thelist. If N*0.43 is not exactly an...


1. Given a list of N (N>=100) distinct integers in unsorted order, write a C or C++ or Java<br>program to find the integer in the list that is greater than exactly 43% of the integers in the<br>list. If N*0.43 is not exactly an integer, then take the floor. For example, if N=120, then the<br>desired integer should be greater than exactly 51 of the integers in the list since<br>120*0.43=51.6. Find the integer without sorting the entire list. The input integers should be<br>retrieved through stdin. Do not use any library classes or functions if they can achieve<br>this functionality directly. Implement the algorithm and logic with your own code. You<br>can add a sorting method to verify that your result is correct. However, if your<br>program finds the desired integer through sorting alone, you will get at most half the<br>credit.<br>When testing, you can first create a text file storing the N unsorted integers (e.g. one integer per<br>line) and then use standard input redirection. Some sample runs can look like the following:<br>C:\user\Myos < integerList.txt<br>183 is the desired integer.<br>C:\user\Myos < intergerList2.txt<br>275 is the desired integer.<br>

Extracted text: 1. Given a list of N (N>=100) distinct integers in unsorted order, write a C or C++ or Java program to find the integer in the list that is greater than exactly 43% of the integers in the list. If N*0.43 is not exactly an integer, then take the floor. For example, if N=120, then the desired integer should be greater than exactly 51 of the integers in the list since 120*0.43=51.6. Find the integer without sorting the entire list. The input integers should be retrieved through stdin. Do not use any library classes or functions if they can achieve this functionality directly. Implement the algorithm and logic with your own code. You can add a sorting method to verify that your result is correct. However, if your program finds the desired integer through sorting alone, you will get at most half the credit. When testing, you can first create a text file storing the N unsorted integers (e.g. one integer per line) and then use standard input redirection. Some sample runs can look like the following: C:\user\Myos < integerlist.txt="" 183="" is="" the="" desired="" integer.="" c:\user\myos="">< intergerlist2.txt 275 is the desired integer. intergerlist2.txt="" 275="" is="" the="" desired="">
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here