<mosaic.cnfolio.com>
PROGRAM
  1. /*Pseudo Code
  2.  
  3. START
  4. Obtain values Pidgeys and Pidgey Candy
  5. State value of XP to be 1000
  6. IF Pidgey is less than 1
  7.   THEN Display Pidgey ERROR Message
  8.   ELSE IF Candy is less than 11
  9.       THEN Display Candy ERROR Message
  10. END IF
  11. Find the Maximum possible evolves with that amount of Candy by dividing Candy/12
  12. IF Number of Pidgeys is bigger than Possible Evolves
  13.   THEN multiply Possible Evolves by 1000 and Display XP and message about having more Candy
  14.   ELSE IF Number of Pidgeys is equal to the possible evolves
  15.          THEN multiply Pidgeys or Possible Evolves by 1000 and Display XP and message about having correct Pidgey/Candy
  16.          ELSE IF Number of Pidgeys is less than Possible Evolves
  17.                 THEN multiply number of Pidgeys by 1000 and Display XP and message about having more Pidgeys
  18. END IF               
  19. Repeat the process for Caterpie and Weedle
  20. Calculate the totalnumber of XP for all 3 Pokemon with a large amount of IF statements
  21. END */
  22.  
  23. #include <stdio.h>
  24. int main (void)
  25. {
  26.  
  27. int Pidgey;
  28. int PidgeyCandy;
  29. int Caterpie ;
  30. int CaterpieCandy;
  31. int Weedle;
  32. int WeedleCandy;
  33. int XP = 1000;
  34.  
  35. /* Example to input Pokemon/Candy e.g. 3 18 4 86 8 46. The first 2 are Pidgey and PidgeyCandy, then Caterpie and Weedle after. */
  36.  
  37. scanf("%d %d", &Pidgey, &PidgeyCandy); /* These are the first 2 numbers you input */
  38.  
  39. double PossEvolves = PidgeyCandy/12;
  40.  
  41.  
  42. if ( Pidgey < 1)
  43.  
  44. printf("ERROR! You don't have any Pidgeys to Evolve!");
  45.  
  46. else if (PidgeyCandy < 12)
  47.  
  48. printf ("ERROR! You don't have enough PidgeyCandy to Evolve!");
  49.  
  50.  
  51. else if (Pidgey > PossEvolves)
  52.  
  53. printf("You will get %.0lfXP with this number of Candy. With more PidgeyCandy you could have more Evolves!", PossEvolves * XP);
  54.  
  55. else if (Pidgey==PossEvolves)
  56.  
  57. printf("You will get %.0lfXP with this number of Pidgeys and Candy. You have the exact amount of Candy for your Pidgeys!", PossEvolves * XP);
  58.  
  59. else if (Pidgey < PossEvolves)
  60.  
  61. printf("You will get %dXP with this number of Pidgeys. With more Pidgeys you could have more Evolves!", Pidgey * XP);
  62.  
  63.  
  64.  
  65. scanf("%d %d", &Caterpie, &CaterpieCandy); /* These are the 3rd and 4th numbers you input */
  66.  
  67. double CatPossEvolves = CaterpieCandy/12;
  68.  
  69. if ( Caterpie < 1)
  70.  
  71. printf("    ERROR! You don't have any Caterpie to Evolve!");
  72.  
  73. else if (CaterpieCandy < 12)
  74.  
  75. printf ("         ERROR! You don't have enough CaterpieCandy to Evolve!");
  76.  
  77.  
  78. else if (Caterpie > CatPossEvolves)
  79.  
  80. printf("    You will get %.0lfXP with this number of Candy. With more CaterpieCandy you could have more Evolves!", CatPossEvolves * XP);
  81.  
  82. else if (Caterpie==CatPossEvolves)
  83.  
  84. printf("    You will get %.0lfXP with this number of Caterpie and Candy. You have the exact amount of Candy for your Caterpie!", CatPossEvolves * XP);
  85.  
  86. else if (Caterpie < CatPossEvolves)
  87.  
  88. printf("    You will get %dXP with this number of Caterpie. With more Caterpie you could have more Evolves!", Caterpie * XP);
  89.  
  90.  
  91.  
  92. scanf("%d %d", &Weedle, &WeedleCandy); /* These are the 5th and 6th numbers you input */
  93.  
  94. double WeedPossEvolves = WeedleCandy/12;
  95.  
  96. if ( Weedle < 1)
  97.  
  98. printf("                ERROR! You don't have any Weedle to Evolve!");
  99.  
  100. else if (WeedleCandy < 12)
  101.  
  102. printf ("                     ERROR! You don't have enough WeedleCandy to Evolve!");
  103.  
  104.  
  105. else if (Weedle > WeedPossEvolves)
  106.  
  107. printf("        You will get %.0lfXP with this number of Candy. With more WeedleCandy you could have more Evolves!", WeedPossEvolves * XP);
  108.  
  109. else if (Weedle==WeedPossEvolves)
  110.  
  111. printf("        You will get %.0lfXP with this number of Weedle and Candy. You have the exact amount of Candy for your Weedle!", WeedPossEvolves * XP);
  112.  
  113. else if (Weedle < WeedPossEvolves)
  114.  
  115. printf("        You will get %dXP with this number of Weedle. With more Weedle you could have more Evolves!", Weedle * XP);
  116.  
  117.  
  118. if ((Pidgey > PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle > WeedPossEvolves))
  119.  
  120. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  121.  
  122. else if ((Pidgey > PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle==WeedPossEvolves))
  123.  
  124. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  125.  
  126. else if ((Pidgey > PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle < WeedPossEvolves))
  127.  
  128. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  129.  
  130. else if ((Pidgey > PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle > WeedPossEvolves))
  131.  
  132. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  133.  
  134. else if ((Pidgey > PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle == WeedPossEvolves))
  135.  
  136. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  137.  
  138. else if ((Pidgey > PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle < WeedPossEvolves))
  139.  
  140. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  141.  
  142. else if ((Pidgey > PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle > WeedPossEvolves))
  143.  
  144. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  145.  
  146. else if ((Pidgey > PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle == WeedPossEvolves))
  147.  
  148. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  149.  
  150. else if ((Pidgey > PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle < WeedPossEvolves))
  151.  
  152. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (Weedle * XP) ) ;
  153.  
  154. else if ((Pidgey == PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle > WeedPossEvolves))
  155.  
  156. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  157.  
  158. else if ((Pidgey == PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle==WeedPossEvolves))
  159.  
  160. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  161.  
  162. else if ((Pidgey == PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle < WeedPossEvolves))
  163.  
  164. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  165.  
  166. else if ((Pidgey == PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle > WeedPossEvolves))
  167.  
  168. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  169.  
  170. else if ((Pidgey == PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle == WeedPossEvolves))
  171.  
  172. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  173.  
  174. else if ((Pidgey == PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle < WeedPossEvolves))
  175.  
  176. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  177.  
  178. else if ((Pidgey == PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle > WeedPossEvolves))
  179.  
  180. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  181.  
  182. else if ((Pidgey == PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle == WeedPossEvolves))
  183.  
  184. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  185.  
  186. else if ((Pidgey == PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle < WeedPossEvolves))
  187.  
  188. printf("                           The total XP for all Evolves is %0.lfXP", (PossEvolves * XP) + (Caterpie * XP) + (Weedle * XP) ) ;
  189.  
  190. else if ((Pidgey < PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle > WeedPossEvolves))
  191.  
  192. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  193.  
  194. else if ((Pidgey < PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle==WeedPossEvolves))
  195.  
  196. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  197.  
  198. else if ((Pidgey < PossEvolves) && (Caterpie > CatPossEvolves) && (Weedle < WeedPossEvolves))
  199.  
  200. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  201.  
  202. else if ((Pidgey < PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle > WeedPossEvolves))
  203.  
  204. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  205.  
  206. else if ((Pidgey < PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle == WeedPossEvolves))
  207.  
  208. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (WeedPossEvolves * XP) ) ;
  209.  
  210. else if ((Pidgey < PossEvolves) && (Caterpie == CatPossEvolves) && (Weedle < WeedPossEvolves))
  211.  
  212. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (CatPossEvolves * XP) + (Weedle * XP) ) ;
  213.  
  214. else if ((Pidgey < PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle > WeedPossEvolves))
  215.  
  216. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  217.  
  218. else if ((Pidgey < PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle == WeedPossEvolves))
  219.  
  220. printf("                           The total XP for all Evolves is %0.lfXP", (Pidgey * XP) + (Caterpie * XP) + (WeedPossEvolves * XP) ) ;
  221.  
  222. else if ((Pidgey < PossEvolves) && (Caterpie < CatPossEvolves) && (Weedle < WeedPossEvolves))
  223.  
  224. printf("                           The total XP for all Evolves is %dXP",    (Pidgey * XP) + (Caterpie * XP) + (Weedle * XP) ) ;
  225.  
  226.  
  227. }