<mosaic.cnfolio.com>
PROGRAM
  1. //Start
  2. //Display welcome back message
  3. //Display message that lucky egg bonus timer is available(doubles all experience gained in 30 minutes)
  4. //Obtain number of Pokemon for evolution
  5. //Obtain number of Pokemon candy for evolution
  6. //IF
  7. //Number of Pokemon and Pokemon candy  for evolution is lesser than 0
  8. //THEN
  9. //Display error message that values equal to or greater than 0 must be inputed
  10.  
  11. //ELSE
  12.   //Display number of Pokemon and number of Pokemon candy
  13.    
  14. //IF
  15.  //number of candy is greater than number of candy multiplied by number of Pokemon
  16. //THEN
  17.   //Calculate number of experience gained with the lucky egg
  18.   //Display number of Pokemon can be evolved
  19. //ELSE
  20.   //Display you do not have enough candy to evolve all your Pokemon
  21. //END
  22. //Display amount of experience gained
  23. //Obtain number of Pokemon candy left by subtracting number of candy used from number of initial candy
  24. //IF number of Pokemon candy is lesser than zero
  25.    //THEN
  26.      //Display you donít have enough Pokemon candy for the evolution
  27.    //ELSE
  28.      //Display amount of Pokemon candy left
  29. //END
  30. //Display total experience gained from all evolutions using the Lucky egg bonus timer
  31. //END
  32.  
  33. #include <stdio.h>
  34.  
  35. int main( void )
  36. {
  37.  
  38.  
  39. int numberofpoke;
  40. int pidgey;
  41. int pidgeycandy;
  42. int pidgeotto;
  43. int weedle;
  44. int weedlecandy;
  45. int kakuna;
  46. int exppidgey;
  47. int exppidgetto;
  48. int expweedle;
  49. int expkakuna;
  50. int totexpgained;
  51.  
  52. //inserting the input information
  53.  
  54. printf("Hello welcome back! You have a lucky egg bonus timer which lasts for 30minutes\n");
  55. printf("How many Pokemon do you want to evolve?\n");
  56. scanf("%d",&numberofpoke);
  57. printf("%d Pokemon\n",numberofpoke);
  58. if(numberofpoke<0) {
  59. printf("\nYour value should be greater than or equal to zero\n");
  60. }
  61.  
  62. //check to see amount of pokemon to be evolved
  63. if (numberofpoke>70)
  64. {printf("\nYou can not evolve above 70 pokemon while using a luckyegg bonus timer ");
  65. }
  66. //it follows through here if the amount of pokemon is allowed
  67. else{
  68. printf("\nHow many Pidgey Pokemon do you want to evolve? ");
  69. scanf("%d",&pidgey);
  70. printf("\n%d Pidgey Pokemon",pidgey);
  71.  
  72. printf("\nHow many Pidgey candies do you have?\n");
  73. scanf("%d", &pidgeycandy);
  74. printf("%d Pidgey Candy\n",pidgeycandy);
  75.  
  76. //is is to check if wrong values are inputed
  77. if(pidgey<0 || pidgeycandy <0) {
  78. printf("\nYour value should be greater than or equal to zero\n");
  79. }
  80.  
  81. //to know if you can evolve a pokemon. Multiply the pokemon to the number of required candy
  82.  
  83. if (pidgeycandy >=12*pidgey)
  84. {printf("\nYou now have %d Pidgeotto Pokemon from your evolution", pidgey);
  85. printf("\nExperience gained is %d\n", exppidgey = pidgey*1000);
  86. }
  87. else
  88. { printf("\nYou donít have enough Pidgey candies to evolve all your Pidgey Pokemons\n");
  89. }
  90. //Now we subtract the amount of candy used from the candy available to see what is left
  91. pidgeycandy-=12*pidgey;
  92. //then we display the candy left
  93. printf("You have %d candy left\n",pidgeycandy);
  94.  
  95. printf("\nHow many  Pidgeotto Pokemon do you want to evolve?");
  96. scanf("%d", &pidgeotto);
  97. printf("\n%d Pidgeotto Pokemon\n",pidgeotto);
  98.  
  99.  
  100. if(pidgeotto<0 || pidgeycandy <0) {
  101. printf("\nYour value should be greater than or equal to zero\n");
  102. }
  103.  
  104.  
  105. if(pidgeycandy >=50*pidgeotto)
  106. {printf("You have now evolved your %d Pidgeotto into Pidgeots\n", pidgeotto);
  107. printf("This is your final evolution of your Pidgey pokemon\n");
  108. printf("Experience gaine is %d\n", exppidgetto = pidgey*1000);
  109. }
  110. else
  111. {printf("\nYou do not have enough Candy for your evolution\n");
  112. }
  113.  
  114. //we subtract the amount of candy left again to see if its less than zero or not
  115.  
  116. if(pidgeycandy-=50*pidgeotto <0)
  117. {printf("\n You have no candy left\n");
  118. }
  119. else
  120. {printf("\nYou have %d candy left\n", pidgeycandy);
  121. }
  122. printf("\nHow many Weedle Pokemon do you want to evolve?\n");
  123. scanf("%d",&weedle);
  124. printf("%d Weedle Pokemon\n",weedle);
  125.  
  126.  
  127. printf("How many Weedle candy do you have?\n");
  128. scanf("%d", &weedlecandy);
  129. printf("%d Weedle candy\n",weedlecandy);
  130.  
  131. if(weedle<0 || weedlecandy <0) {
  132. printf("\nYour value should be greater than or equal to zero\n");
  133. }
  134.  
  135.  
  136.  
  137. if(weedlecandy >=12*weedle)
  138. {printf("\nYou have now evolved your %d Weedle into Kakuna\n", weedle);
  139. printf("Experience gaine is %d\n", expweedle = weedle*1000);
  140. }
  141. else
  142. {printf("\nYou do not have enough Candy for your evolution\n");
  143. }
  144.  
  145. weedlecandy-=12*weedle;
  146. printf("You have %d candy left\n",weedlecandy);
  147.  
  148. printf("\nHow many  Kakuna Pokemon do you want to evolve\n");
  149. scanf("%d", &kakuna);
  150. printf("%d Kakuna Pokemon\n",kakuna);
  151.  
  152.  
  153. if(kakuna<0 || weedlecandy <0) {
  154. printf("\nYour value should be greater than or equal to zero\n");
  155. }
  156.  
  157.  
  158.  
  159. if(weedlecandy >=50*kakuna)
  160. {printf("\nYou have now evolved your %d kakuna into Beedrill Pokemon\n", kakuna);
  161. printf("This is your final evolution of your Weedle pokemon\n");
  162. printf("Experience gaine is %d\n", expkakuna = kakuna*1000);
  163. }
  164. else
  165. {printf("\nYou do not have enough Candy for your evolution\n");
  166. }
  167.  
  168.  
  169. if(weedlecandy-=50*kakuna <0)
  170. {printf("\n You have no candy left\n");
  171. }
  172. else
  173. {printf("\nYou have %d candy left\n", weedlecandy);
  174. }
  175.  
  176. //displays total experience gained from the evolutions
  177. printf("\nThe total experience gained for all your evolutions is %d\n",totexpgained= expweedle+exppidgey+exppidgetto+expkakuna);
  178. }
  179. }