jaredec18

Untitled

Sep 28th, 2019
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.49 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. void findMatchedGenome(string genome1,string genome2,string genome3,string seq);
  8. int main(void) {
  9. //Declaring variables
  10. findMatchedGenome("TTC","GCC","TCT","");
  11. return 0;
  12. }
  13. void findMatchedGenome(string genome1,string genome2,string genome3,string seq)
  14. {
  15. if(genome1.compare("")==0 || genome2.compare("")==0||genome3.compare("")==0|| seq.compare("")==0)
  16. {
  17. cout<<"Genomes or sequence is empty."<<endl;
  18. }
  19. else if(genome1.length()!=genome2.length() ||
  20. genome2.length()!=genome3.length() ||
  21. genome3.length()!=genome1.length())
  22. {
  23. cout<<"Lengths of genomes are different."<<endl;
  24. }
  25. else
  26. {
  27. if(genome1.compare(seq)==0)
  28. {
  29. cout<<"Genome1 is matched to sequence."<<endl;
  30. }
  31. else if(genome2.compare(seq)==0)
  32. {
  33. cout<<"Genome2 is matched to sequence."<<endl;
  34. }
  35. else if(genome3.compare(seq)==0)
  36. {
  37. cout<<"Genome3 is matched to sequence."<<endl;
  38. }
  39. else
  40. {
  41. cout<<"No Genome is matched to sequence."<<endl;
  42. }
  43.  
  44. }
  45. }
  46.  
  47. ___________________________
  48.  
  49. Output:
  50. https://media.cheggcdn.com/media/3af/3af724e3-f6a0-4c87-9f7b-3c62fd4c6f86/phpJeNJal.png
Advertisement
Add Comment
Please, Sign In to add comment