<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2.    printf "define the two inputs for the user"
  3.    
  4.    int number1 and number2 (candy and pidgeys)
  5.    scanf number1 and number2
  6.  
  7.       IF requirements to seperat the two equations for calculating the xp.
  8.          printf final result of xp, when there is enough candy left over to evolve a pidgeotto
  9.       Else
  10.          printf final result of xp, when there is only enough candy to just evolve pidgeys
  11. */
  12.  
  13.  
  14.  
  15.  
  16.  
  17.  
  18. #include <stdio.h>
  19. int main( void )
  20. {
  21.    printf( "Please enter the number of Pidgey Candy, and then the number of Pidgeys.\n\n" )/* Print instructions to user on which data value to enter first. this avoids confusion and provides ease of use. */
  22.    
  23.    int number1, number2;   /* Use int and not float. no need for decimal numbers */
  24.    scanf( "%d %d", &number1, &number2 );   /* Accept inputs given as numbers, ignoring decimal points. */
  25.    
  26.    if( (number1 / 12)>(number2) )       /* This seperates the two equations for calculating xp. this also makes troubleshooting code as it seperates the strings. */
  27.    {
  28.    printf( "Number of Pidgey Pokemon: %d \nNumber of Pidgey Candy: %d", number2, number1 );   /* This is simply to provide a full spectrum of relevent infomation to the user, also validates inputs with the user */
  29.    printf( "\nYou can gain a maximum of %d xp while using a lucky egg! \n\n Steps: \n1. Evolve all your Pidgey Pokemon to Pidgeotto, \n2. Evolve %d Pidgeotto Pokemon to Pidgeot.\n\nThis will ensure you gain maximum potential xp! ", ((number2 + ((number1 - (12 * number2)) / 50)) * 1000 ),(number1 - (12 * number2)) / 50) ; /* printing the final xp gain is not enough. this equation also provides infomation to the user on how to evolve the pokemon and maximise xp */
  30.    }
  31.    else /* for calculation with just evolving pidgeys*/
  32.    {
  33.    printf( "Number of Pidgey Pokemon: %d \nNumber of Pidgey Candy: %d", number2, number1 );
  34.    printf( "\nYou can gain a maximum of %d xp while using a lucky egg! \n\n Steps: \n1. Evolve %d Pidgey pokemon to Pidgeotto.\n\nThis will ensure you gain maximum potential xp!", (number1 / 12) * 1000 , (number1 /12));   /* print result of xp gain without any pigeotto evolutions */
  35.    }
  36. }