<mosaic.cnfolio.com>
PROGRAM
  1. // PSEUDO CODE FOR PROGRAM //
  2. /*
  3. Main function
  4. Variable declarations
  5. Integer pokemon
  6. Integer Candy
  7. Integer maxxp
  8. Integer evolvedpoke
  9. Integer reqcandy
  10. Integer remaincandy
  11. Integer xpperpoke
  12. Integer xpevolved
  13. Integer combinedxp
  14.  
  15. Display to enter pokemons
  16. Read entered pokemons
  17.  
  18. Display to enter candy
  19. Read entered candies
  20.  
  21. IF pokemon less than or equal to one and candy less than or equal to one
  22. THEN
  23. Display Error 404 Message
  24. ELSE
  25. Reqcandy equals to pokemon multiplied by 12
  26. Display Required candies for pidgey pokemons
  27.  
  28. Evolvedpoke equals to candy minus one divided by eleven
  29.  
  30. IF candy minus one divided by eleven is less than the pokemon
  31. THEN
  32. Display evolved pokemons
  33. ELSE IF candy minus one divided by eleven is greater than or equal to pokemon
  34. THEN
  35. Display Evolved Pokemons
  36.  
  37. Xp per poke equals 500
  38. Xp evolved equals evolved pokemon multiplied by 500
  39. Display Xp without Egg Bonus
  40.  
  41. Max Xp equals Xp evolved multiplied by 2
  42. END ELSE
  43.  
  44. // PSEUDO FOR RATTATA POKEMON //
  45. Integer ratpoke equals zero
  46. Integer ratcandy equals zero
  47. Integer reqratcandy equals zero
  48. Integer evolvedrat 
  49. Integer xpperrat
  50. Integer xpratevolve
  51. Integer maxratxp
  52.  
  53. Display to enter ratt pokemons
  54. Read entered ratt pokemons
  55.  
  56. Display to enter ratt candy
  57. Read entered ratt candies
  58.  
  59. IF ratt pokemon less than or equal to one and ratt candy less than or equal to one
  60. THEN
  61. Display Error 404 Message
  62. ELSE
  63. ReqRatcandy equals to ratt pokemon multiplied by 25
  64. Display Required candies for Ratt pokemons
  65.  
  66. EvolvedRatPoke equals to Rat candy minus one divided by twenty four
  67.  
  68. IF candy minus one divided by twenty four is less than the ratt pokemon
  69. THEN
  70. Display evolved ratt pokemons
  71. ELSE IF rat candy minus one divided by twenty four is greater than or equal to rat pokemon
  72. THEN
  73. Display Evolved rat Pokemons
  74.  
  75. Xp per ratpoke equals 500
  76. Xp rat evolved equals evolved rat pokemon multiplied by 500
  77. Display Xp without Egg Bonus
  78.  
  79. MaxRatXp equals Xp Rat evolved multiplied by 2
  80. END ELSE
  81.  
  82. // PSEUDO FOR RATTATA POKEMON //
  83. Integer zubatpoke equals zero
  84. Integer zubatcandy equals zero
  85. Integer reqzubatcandy equals zero
  86. Integer evolvedzubat 
  87. Integer xpperzubat
  88. Integer xpzubatevolve
  89. Integer maxzubatxp
  90.  
  91. Display to enter zubat pokemons
  92. Read entered zubat pokemons
  93.  
  94. Display to enter zubat candy
  95. Read entered zubat candies
  96.  
  97. IF zubat pokemon less than or equal to one and zubat candy less than or equal to one
  98. THEN
  99. Display Error 404 Message
  100. ELSE
  101. Reqzubatcandy equals to zubat pokemon multiplied by 50
  102. Display Required candies for zubat pokemons
  103.  
  104. EvolvedzubatPoke equals to zubat candy minus one divided by forty-nine
  105.  
  106. IF candy minus one divided by fifty is less than the zubat pokemon
  107. THEN
  108. Display evolved zubat pokemons
  109. ELSE IF zubat candy minus one divided by fifty is greater than or equal to zubat pokemon
  110. THEN
  111. Display Evolved zubat Pokemons
  112.  
  113. Xp per zubatpoke equals 500
  114. Xp zubat evolved equals evolved zubat pokemon multiplied by 500
  115. Display Xp without Egg Bonus
  116.  
  117. MaxzubatXp equals Xp Rat evolved multiplied by 2
  118. END ELSE
  119.  
  120. END PROGRAM
  121.  
  122. ADDITIONAL COMMENTS: I PURPOSELY MADE THE PROGRAM IN 3 SECTIONS FOR A HIGHER ACCURACY AND LESS CONFUSION :)
  123.  
  124. */
  125.  
  126. // PROGRAM STARTS HERE //
  127. #include <stdio.h>
  128.  
  129. int main() // Main Function
  130. // Variable Declarations //
  131. {
  132. int pokemon = 0;
  133. int candy = 0;
  134. int maxxp;
  135. int evolvedpoke;
  136. int reqcandy;
  137. int remaincandy;
  138. int a;
  139. int xpperpoke;
  140. int xpevolved;
  141. int combinedxp;
  142.  
  143. printf("enter number of pidgey pokemons\n"); // Display Message To Enter Pokemon //
  144. scanf("%d", &pokemon); // Display Message To Read Entered Pokemon //
  145.  
  146. printf("enter pidgey candy\n"); // Display Message To Enter Candy //
  147. scanf("%d", &candy); // Display Message To Read Entered Candy //
  148.  
  149. if((pokemon <=1) || (candy <=1)) // Missing Values Condition Check //
  150. {
  151.    printf("Error 404: Enter Values For Pidgey Mate \n"); // Error Message For Missing Values //
  152. }
  153.  
  154. else{ // Condition If Values Entered And The Program Continues //
  155. reqcandy = pokemon * 12; // Required Candy For Pokemons Entered //
  156. printf("Required Candy To Evolve All Pidgey Pokemons Entered %d \n", reqcandy); // Display Message For Required Candy //
  157.  
  158. remaincandy = candy - reqcandy; // Calculation For Remaining Candy ( Not Displayed Though ) //
  159. evolvedpoke = ((candy - 1) / 11); // Calculation For Evolving Pidgey Pokemon //
  160.  
  161. if(((candy - 1) / 11) < pokemon) // Condition Testing For Candies less than Pokemons //
  162. {
  163.    printf("Evolved Pidgey Pokemon %d\n",evolvedpoke); // display message for evolved pokemon //
  164. }
  165.  
  166. else if(((candy - 1) /11) >= pokemon) // Condition Testing For Candies More Than Pokemons //
  167. {
  168.    evolvedpoke = pokemon;
  169.    printf("Evolved Pidgey Pokemon %d\n",evolvedpoke); // Display Message For Evolved Pokemon //
  170. }
  171.  
  172. // Xp Per Pokemon Evolution //
  173. xpperpoke = 500; // Xp For Each Pokemon Evolved //
  174. xpevolved = evolvedpoke * 500; // Xp Gained For Number of Pokemons Evolved //
  175. printf("Xp Without Egg Bonus %d \n",xpevolved); // Bonus Display Message For Xp without Lucky Egg //
  176.  
  177. // Xp with Lucky Egg Bonus //
  178. maxxp = xpevolved * 2; // Max Xp Calculation With Lucky Egg Bonus Used //
  179. printf("Xp With Lucky Egg and Evolved Pidgey Pokemon %d\n\n",maxxp); // Display Message For Max Xp //
  180.  
  181. } // Condition Ends //
  182.  
  183. // RATTATA POKEMON SECTION BEGINS HERE //
  184. // Variable Declarations //
  185. int ratpoke = 0;
  186. int ratcandy = 0;
  187. int reqratcandy = 0;
  188. int evolvedrat;
  189. int xpperrat;
  190. int xpratevolve;
  191. int maxratxp;
  192.  
  193. printf("enter number of rattata pokemons\n"); // Display Message To Enter Pokemon //
  194. scanf("%d", &ratpoke); // Display Message To Read Entered Pokemon //
  195.  
  196. printf("enter rattata candy\n"); // Display Message To Read Entered Candy //
  197. scanf("%d", &ratcandy); // Display Message To Read Entered Candy //
  198.  
  199. if((ratpoke <= 1) || (ratcandy <=1)) // Missing Values Condition Check //
  200. {
  201.    printf("Error 404: Enter Values For Rattata Mate !\n\n"); // Error Message For Missing Values //
  202. }
  203.  
  204. else // Condition If Values Entered And The Program Continues //
  205. {
  206. reqratcandy = ratpoke * 25; // Required Candy For Pokemons Entered //
  207. printf("Required Candy To Evolve Rattata Pokemons %d\n", reqratcandy); // Display Message For Required Candy //
  208.  
  209. evolvedrat = (((ratcandy - 1) / 24)); // Calculation For Evolving Rattata Pokemon //
  210.  
  211. if(((ratcandy - 1) / 24) <= ratpoke) // Condition Testing For Candies less than Pokemons //
  212. {
  213.    printf("Evolved Rattata %d\n",evolvedrat); // display message for evolved pokemon //
  214. }
  215.  
  216. else if(((ratcandy - 1) /24) >= ratpoke) // Condition Testing For Candies More Than Pokemons //
  217. {
  218.    evolvedrat = ratpoke;
  219.    printf("Evolved Rattata Poke %d\n",evolvedpoke); // Display Message For Evolved Pokemon //
  220. }
  221.  
  222. // Xp Per Pokemon Evolution //
  223. xpperrat = 500; // Xp For Each Pokemon Evolved //
  224. xpratevolve = evolvedrat * 500; // Xp Gained For Number of Pokemons Evolved //
  225. printf("Xp Without Egg Bonus %d \n",xpratevolve); // Bonus Display Message For Xp without Lucky Egg //
  226.  
  227. // Xp with Lucky Egg Bonus //
  228. maxratxp = xpratevolve * 2; // Max Xp Calculation With Lucky Egg Bonus Used //
  229. printf("Xp With Lucky Egg and Evolved Pokemon %d\n\n",maxratxp); // Display Message For Max Xp //
  230.  
  231. } // Condition Ends //
  232.  
  233. // ZUBAT POKEMON SECTION BEGINS HERE //
  234. // Variable Declaration //
  235. int zubatpoke = 0;
  236. int zubatcandy = 0;
  237. int evolvedzubat;
  238. int reqzubatcandy;
  239. int xpperzubat;
  240. int xpzubatevolved;
  241. int maxzubatxp;
  242.  
  243. printf("enter number of zubat pokemons\n"); // Display Message To Enter Pokemon //
  244. scanf("%d", &zubatpoke); // Display Message To Read Entered Pokemon //
  245.  
  246. printf("enter zubat candy\n"); // Display Message To Read Entered Candy //
  247. scanf("%d", &zubatcandy); // Display Message To Read Entered Candy //
  248.  
  249. if((zubatpoke <= 1) || (zubatcandy <=1)) // Missing Values Condition Check //
  250. {
  251.    printf("Error 404: Enter Values For Zubat Mate !\n\n"); // Error Message For Missing Values //
  252. }
  253.  
  254. else // Condition If Values Entered And The Program Continues //
  255. {
  256. reqzubatcandy = zubatpoke * 50; // Required Candy For Pokemons Entered //
  257. printf("Required Candy To Evolve Zubat Pokemons %d\n", reqzubatcandy); // Display Message For Required Candy //
  258.  
  259. evolvedzubat = (((zubatcandy - 1) / 49)); // Calculation For Evolving Pidgey Pokemon //
  260.  
  261. if(((zubatcandy - 1) / 49) <= zubatpoke) // Condition Testing For Candies less than Pokemons //
  262. {
  263.    printf("Evolved Zubat %d\n",evolvedzubat); // display message for evolved pokemon //
  264. }
  265.  
  266. else if(((zubatcandy - 1) /49) >= zubatpoke) // Condition Testing For Candies More Than Pokemons //
  267. {
  268.    evolvedzubat = zubatpoke;
  269.    printf("Evolved zubat Poke %d\n",evolvedzubat); // Display Message For Evolved Pokemon //
  270. }
  271.  
  272. // Xp Per Pokemon Evolution //
  273. xpperzubat = 500; // Xp For Each Pokemon Evolved //
  274. xpzubatevolved = evolvedzubat * 500; // Xp Gained For Number of Pokemons Evolved //
  275. printf("Xp Without Egg Bonus %d \n",xpzubatevolved); // Bonus Display Message For Xp without Lucky Egg //
  276.  
  277. // Xp with Lucky Egg Bonus //
  278. maxzubatxp = xpzubatevolved * 2; // Max Xp Calculation With Lucky Egg Bonus Used //
  279. printf("Xp With Lucky Egg and Evolved Pidgey Pokemon %d\n\n",maxzubatxp); // Display Message For Max Xp //
  280. } // Condition Ends //
  281.  
  282. combinedxp = maxxp + maxratxp + maxzubatxp;
  283. printf("Combined Max Xp Of All 3 Pokemons %d \n", combinedxp);
  284. } // End Of Program //