Question: Hello, I would like a JAVA program following these code. I need to do similar to a dating app but only with numbers, assuming NPEOPLE

Hello, I would like a JAVA program following these code. I need to do similar to a dating app but only with numbers, assuming NPEOPLE is int. Then I need to se in screen something like this. For Example compatible [10] = 25 meaning that the person #10 like person #25 but not necessary the other way.

 


1. /* Check all people */
2. int i,j;
3. for(i=0; i4. /* Initialize the array of frequencies */
5. freq[i]=0;
6. /* Check all people */
7. for(j=0; j8. /* If the person is compatible with other,
9. increase the frequency */
10. if( i==compatible[j])
11. freq[i]++;
12. }
13. /* Initialize the maximum frequency */
14. max=0;
15. /* Check all people */
16. for(i=0; i17. /* If the frequency is higher than the maximum,
18. save as maximum */
19. if(freq[i]>max)
20. max=freq[i];
21. }
22. /* Print the result */
23. printf("The person with more affinity is:
%d",compatible[max]);

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Certainly Below is a Java program that implements the functionality you described This program calcu... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!