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
Step: 1
Certainly Below is a Java program that implements the functionality you described This program calcu...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started