<mosaic.cnfolio.com>
PROGRAM
  1. #include <stdio.h>
  2. /*include studio.h includes standard input and output to the program*/
  3. int main(void)
  4. {
  5. int NumberOfPidgeys, NumberOfCandies ;
  6. /* this includes the integer values for the Number of Pidgeys and Number of candies a player has*/
  7. float NumberOfEvolvedPidgeys,XpWithoutEgg, XpWithEgg;
  8. /* Tried to use Int for these but the program would only work if they were floats or doubles, not sure why? */
  9. printf("Hello and welcome to my Pokemon Go XP calculator\n");
  10. /* printf is used to output data*/
  11. printf("Please enter the number of Pidgey Pokemons and the number of Pidgey Candies you have. \n(A Pidgey requires 12 candies to evolve)\n");
  12. scanf("%d %d", &NumberOfPidgeys, &NumberOfCandies);
  13. /* I used scanf to read the integer values entered for the number of pidgeys and the number of candies*/
  14. if(NumberOfPidgeys==0.)
  15.                       {    printf("ERROR,You have no Pidgeys so cannot evolve");
  16.                       }
  17. else if(NumberOfPidgeys>0){                     
  18. /* I used this if and else if statement to not allow a user to enter calculate xp when the user has no Pidgeys8 */
  19. NumberOfEvolvedPidgeys=(NumberOfCandies/12);
  20. /* NumberOfEvolvedPidgeys is the value we multiply by the xp per evolution number to reach the xp gained value.
  21. We Calculate this by dividing the number of candies by 12 because each Pidgey requires 12 candies to evolve*/
  22. XpWithoutEgg=(NumberOfEvolvedPidgeys *500);
  23. /* We times the evolved pidgeys number by 500 because a player reciveves 500 xp per evolution */
  24. ("%f %g", &XpWithoutEgg, &XpWithEgg);
  25. printf("\n XP gained without using a Lucky egg=%f", XpWithoutEgg);
  26. XpWithEgg=(XpWithoutEgg * 2);
  27. /* A lucky egg multiplies the xp by 2 which is why XPWithEgg=XpWithoutEgg*2 */
  28. printf("\n XP gained with a lucky egg=%g", XpWithEgg);
  29. }
  30. }