Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.86 KB | None | 0 0
  1. void compareDNA(char DNA[][10], int relCount, int results[][10])
  2. {
  3.  
  4. for (int i = 0; i < relCount; i++)
  5. {
  6. int match;
  7. for (int x = 0; x < 10; x++)
  8. {
  9. if (DNA[0][x] == DNA[i + 1][x])
  10. {
  11. match++;
  12.  
  13. }
  14. } match = match * 10;
  15. results[match];
  16.  
  17. }
  18. ///////////////////////////////////////////////////////
  19. void displayResults(char relName[][10], int results[][10], int relCount)
  20. {
  21. for (int i = 0; i < relCount; i++)
  22. {
  23. cout << "Percent match for " << relName[i + 1] << ": " << results[i + 1][10] << "%" << endl;
  24. }
  25. }
  26. /////////////////////////////////////////
  27. int main()
  28. {
  29. char DNA[10][10];
  30. int relCount;
  31. char relName[10][10];
  32. int results[10][10];
  33.  
  34. getDNA(DNA);
  35. getRelCount(relCount);
  36. getRelName(relName, relCount);
  37. getRelDNA(DNA, relName, relCount);
  38. compareDNA(DNA, relCount, results);
  39. displayResults(relName, results, relCount);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement