Simple Zodiac Sign Using If - Else Statement

Language

This is a simple zodiac sign project where the system will tell you of your zodiac sign by inputting of your birth date. This is very easy to do project. Try this yourself and learn some new codes. Hope you learn from this. This is the full source code of the system.
  1. #include<iostream>
  2. using namespace std;
  3. int main() {
  4.  
  5. int a = 0;
  6. int date,month;
  7.  
  8. start:
  9. cout << "\n\n\n\t\t"
  10. " This Program will determine your Zodiac Sign."
  11. " \n\n\n\n\t\t "
  12. " Input Your Birth Month No.: ";
  13. cin >> month;
  14.  
  15. cout << " \n\t\t "
  16. " Input Your Birth Date: ";
  17. cin >> date;
  18.  
  19. if (month == 3 && date >= 21 || month == 4 && date <= 20)
  20. {
  21. cout<<"\n\n\n\t\t Your Zodiac Sign is Aries! "; cout<<endl;
  22. }
  23. else if (month == 4 && date >= 21 || month == 5 && date <= 21)
  24. {
  25. cout<<"\n\n\n\t\t Your Zodiac sign is Taurus"; cout<<endl;
  26. }
  27. else
  28. if (month == 5 && date >= 22 || month == 6 && date <= 22)
  29. {
  30. cout<<"\n\n\n\t\t Your Zodiac sign is Gemini"; cout<<endl;
  31. }
  32. else if (month == 6 && date >= 23 || month == 7 && date <= 23)
  33. {
  34. cout<<"\n\n\n\t\t Your Zodiac is Cancer"; cout<<endl;
  35. }
  36. else if (month == 7 && date >= 24 || month == 8 && date <= 23)
  37. {
  38. cout<<"\n\n\n\t\t Your Zodiac sign is Leo"; cout<<endl;
  39. }
  40. else if (month == 8 && date >= 24 || month == 9 && date <= 23)
  41. {
  42. cout<<"\n\n\n\t\t Your Zodiac sign is Virgo"; cout<<endl;
  43. }
  44. else if (month == 9 && date >= 24 || month == 10 && date <= 23)
  45. {
  46. cout<<"\n\n\n\t\t Your Zodiac sign is Libra"; cout<<endl;
  47. }
  48. else if (month == 10 && date >= 24 || month == 11 && date <= 22)
  49. {
  50. cout<<"\n\n\n\t\t Your Zodiac sign is Scorpio"; cout<<endl;
  51. }
  52. else if (month == 11 && date >= 24 || month == 12 && date <= 21)
  53. {
  54. cout<<"\n\n\n\t\t Your Zodiac sign is Saguittarius"; cout<<endl;
  55. }
  56. else if (month == 12 && date >= 22 || month == 1 && date <= 20)
  57. {
  58. cout<<"\n\n\n\t\t Your Zodiac sign is Capricorn"; cout<<endl;
  59. }
  60. else if (month == 1 && date >= 21 || month == 2 && date <= 19)
  61. {
  62. cout<<"\n\n\n\t\t Your Zodiac sign is Aquarius"; cout<<endl;
  63. }
  64. else if (month == 2 && date >= 20 || month == 3 && date <= 20)
  65. {
  66. cout<<"\n\n\n\t\t Your Zodiac sign is Pieces"; cout<<endl;
  67. }
  68. else {
  69. cout << "\n\t\t\t Incorrect Input!! Try Again! ";
  70.  
  71. system ("pause");
  72. system("cls");
  73. goto start;
  74. }
  75.  
  76. cout << " \n\n \t\t To Try Again Press 1, or Press 2 to Quit ";
  77. cin >> a;
  78. system ("cls");
  79.  
  80. if (a==1)
  81. goto start;
  82. if (a==2)
  83. {
  84. cout << "\n";
  85. }
  86.  
  87. return 0;
  88. }

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Add new comment