Advertisement
lrm2000

Birthday and Horoscope 2016

Sep 19th, 2017
30
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.58 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class Main
  4. {
  5. public static void main(String[] args)
  6. {
  7.  
  8.  
  9. Scanner scan = new Scanner (System.in);
  10.  
  11. int num = 0;
  12.  
  13. System.out.println("On what day of the month were you born? (number)");
  14. int day = scan.nextInt();
  15. System.out.println("In which month were you born? (number)");
  16. int month = scan.nextInt();
  17.  
  18. //Error
  19. if ((month < 1 || month > 12) || (day < 1 || day > 31)) {
  20. System.out.println("error");
  21. }
  22.  
  23. //Sign
  24. if ((month == 3 && day >= 21) || (month == 4 && day <= 19)) {
  25. System.out.println("Your sign is Aries");
  26. num = 1;
  27. }
  28.  
  29. if ((month == 4 && day >= 20) || (month == 5 && day <= 20)) {
  30. System.out.println("Your sign is Taurus");
  31. num = 2;
  32. }
  33.  
  34. if ((month == 5 && day >= 21) || (month == 6 && day <= 20)) {
  35. System.out.println("Your sign is Gemini");
  36. num = 3;
  37. }
  38.  
  39. if ((month == 6 && day >= 21) || (month == 7 && day <= 22)) {
  40. System.out.println("Your sign is Cancer");
  41. num = 4;
  42. }
  43.  
  44. if ((month == 7 && day >= 23) || (month == 8 && day <= 22)) {
  45. System.out.println("Your sign is Leo");
  46. num = 5;
  47. }
  48.  
  49. if ((month == 8 && day >= 23) || (month == 9 && day <= 22)) {
  50. System.out.println("Your sign is Virgo");
  51. num = 6;
  52. }
  53.  
  54. if ((month == 9 && day >= 23) || (month == 10 && day <= 22)) {
  55. System.out.println("Your sign is Libra");
  56. num = 7;
  57. }
  58.  
  59. if ((month == 10 && day >= 23) || (month == 11 && day <= 21)) {
  60. System.out.println("Your sign is Scorpio");
  61. num = 8;
  62. }
  63.  
  64. if ((month == 11 && day >= 22) || (month == 12 && day <= 21)) {
  65. System.out.println("Your sign is Sagittarius");
  66. num = 9;
  67. }
  68.  
  69. if ((month == 12 && day >= 22) || (month == 1 && day <= 19)) {
  70. System.out.println("Your sign is Capricorn");
  71. num = 10;
  72. }
  73.  
  74. if ((month == 1 && day >= 20) || (month == 2 && day <= 18)) {
  75. System.out.println("Your sign is Aquarius");
  76. num = 11;
  77. }
  78.  
  79. if ((month == 2 && day >= 19) || (month == 3 && day <= 20)) {
  80. System.out.println("Your sign is Pisces");
  81. num = 12;
  82. }
  83.  
  84.  
  85.  
  86. //Birthday
  87. String dayy = ("bleh");
  88. String monthh = ("bleh");
  89.  
  90. if (month == 1) {
  91. monthh = ("January");
  92. }
  93. if (month == 2) {
  94. monthh = ("Febuary");
  95. }
  96. if (month == 3) {
  97. monthh = ("March");
  98. }
  99. if (month == 4) {
  100. monthh = ("April");
  101. }
  102. if (month == 5) {
  103. monthh = ("May");
  104. }
  105. if (month== 6) {
  106. monthh = ("June");
  107. }
  108. if (month == 7) {
  109. monthh = ("July");
  110. }
  111. if (month == 8) {
  112. monthh = ("August");
  113. }
  114. if (month == 9) {
  115. monthh = ("September");
  116. }
  117. if (month == 10) {
  118. monthh = ("October");
  119. }
  120. if (month == 11) {
  121. monthh = ("November");
  122. }
  123. if (month == 12) {
  124. monthh = ("December");
  125. }
  126. //----------------------------------------------------------------------------------
  127. if (day == 1) {
  128. dayy = ("first");
  129. }
  130. if (day == 2) {
  131. dayy = ("second");
  132. }
  133. if (day == 3) {
  134. dayy = ("third");
  135. }
  136. if (day == 4) {
  137. dayy = ("fourth");
  138. }
  139. if (day == 5) {
  140. dayy = ("fifth");
  141. }
  142. if (day == 6) {
  143. dayy = ("sixth");
  144. }
  145. if (day == 7) {
  146. dayy = ("seventh");
  147. }
  148. if (day == 8) {
  149. dayy = ("eighth");
  150. }
  151. if (day == 9) {
  152. dayy = ("ninth");
  153. }
  154. if (day == 10) {
  155. dayy = ("tenth");
  156. }
  157. if (day == 11) {
  158. dayy = ("eleventh");
  159. }
  160. if (day == 12) {
  161. dayy = ("twelfth");
  162. }
  163. if (day == 13) {
  164. dayy = ("thirteenth");
  165. }
  166. if (day == 14) {
  167. dayy = ("fourteenth");
  168. }
  169. if (day == 15) {
  170. dayy = ("fifthteenth");
  171. }
  172. if (day == 16) {
  173. dayy = ("sixteenth");
  174. }
  175. if (day == 17) {
  176. dayy = ("seventeenth");
  177. }
  178. if (day == 18) {
  179. dayy = ("eighteenth");
  180. }
  181. if (day == 19) {
  182. dayy = ("nineteenth");
  183. }
  184. if (day == 20) {
  185. dayy = ("twentieth");
  186. }
  187. if (day == 21) {
  188. dayy = ("twenty-first");
  189. }
  190. if (day == 22) {
  191. dayy = ("twenty-second");
  192. }
  193. if (day == 23) {
  194. dayy = ("twenty-third");
  195. }
  196. if (day == 24) {
  197. dayy = ("twenty-fourth");
  198. }
  199. if (day == 25) {
  200. dayy = ("twenty-fifth");
  201. }
  202. if (day == 26) {
  203. dayy = ("twenty-sixth");
  204. }
  205. if (day == 27) {
  206. dayy = ("twenty-seventh");
  207. }
  208. if (day == 28) {
  209. dayy = ("twenty-eighth");
  210. }
  211. if (day == 29) {
  212. dayy = ("twenty-ninth");
  213. }
  214. if (day == 30) {
  215. dayy = ("thirtieth");
  216. }
  217. if (day == 31) {
  218. dayy = ("thirty-first");
  219. }
  220.  
  221. if (!((month < 1 || month > 12) || (day < 1 || day > 31))) {
  222. System.out.println("Your birthday is: " + monthh + " " + dayy);
  223. }
  224.  
  225.  
  226.  
  227.  
  228. //Horoscope
  229. if (num == 1){
  230. System.out.println("Horoscope: Brushing your teeth with boiling water is very likely to burn your mouth.");
  231. }
  232. if (num == 2){
  233. System.out.println("Horoscope: In 10 minutes from now, you will be 10 minutes older.");
  234. }
  235. if (num == 3){
  236. System.out.println("Horoscope: If you take your age, add two, and then subtract two, that is your exact age.");
  237. }
  238. if (num == 4){
  239. System.out.println("Horoscope: If you put your hand in fire you will learn that it is not cold.");
  240. }
  241. if (num == 5){
  242. System.out.println("Horoscope: You should not drink boiling water.");
  243. }
  244. if (num == 6){
  245. System.out.println("Horoscope: If you cut off your hand it most likely won't grow back.");
  246. }
  247. if (num == 7){
  248. System.out.println("Horoscope: Getting out of your car to lick the road will not solve any of your personal problems.");
  249. }
  250. if (num == 8){
  251. System.out.println("Horoscope: Losing weight will cause you to weigh less.");
  252. }
  253. if (num == 9){
  254. System.out.println("Horoscope: If you are reading this, congratulations, you have been born.");
  255. }
  256. if (num == 10){
  257. System.out.println("Horoscope: If you are breathing right now, you are probably not a rock.");
  258. }
  259. if (num == 11){
  260. System.out.println("Horoscope: Switching to Geico could save you 15% or more on car insurance.");
  261. }
  262. if (num == 12){
  263. System.out.println("Horoscope: If you jump in an empty pool, it will probably not make a splash.");
  264. }
  265.  
  266. }
  267. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement