<mosaic.cnfolio.com>
PROGRAM
  1. #include <stdio.h>
  2.  
  3. int main() {
  4.     int pidgeyPokemons;
  5.     int pidgeyCandy;
  6.     int evolvedPidgey;
  7.     int XP;
  8.     int evolvedCandy;
  9.     int unevolvedPidgey;
  10.     int candyLeft;
  11.    
  12.    printf("Enter the number of pidgey pokemons: \n"); /*read the users input. Input must be a value between 0 and 100*/     
  13.    scanf("%d", &pidgeyPokemons);
  14.    printf("Enter the number of pidget candy: \n"); /*read the users input. Input must be a value of 12 or more*/
  15.    scanf("&d", &pidgeyCandy);
  16.  
  17.    if (pidgeyPokemons < 0) /*if the number entered is less than zero program should print an error message (task 3)
  18.                   if the number entered is positive and larger than 0 the program will run and the error message will not be displayed*/
  19.    {
  20.    printf("An incorrect value has been entered, please enter a positive number\n\n"); //error message
  21.    }
  22.  
  23.    if (pidgeyPokemons == 0) /*if the number entered is less than zero program should print an error message (task 3)
  24.          if the number entered is positive and larger than 12 the program will run and the error message will not be displayed*/
  25.    {
  26.    printf("There are not enough pidgies, please enter a number whole number above 0 \n\n");
  27.    }
  28.  
  29.    if (pidgeyCandy < 12) /*if the number entered is less than 12 program should print another error message (task 3)*/
  30.    {
  31.       if (pidgeyCandy >= 0) /*different error message that states that anything less tham 12 candies isn't enough*/
  32.    {
  33.    printf("There are not enough candies, please enter a whole number larger than 11\n\n"); /*error message*/
  34.    }
  35.    }
  36.    if (pidgeyCandy < 0)
  37.    {
  38.    printf("An incorrect value has been entered, please enter a positive number\n\n"); //error message
  39.    }
  40.    
  41.    else if (((pidgeyCandy-1)/11) > pidgeyPokemons)
  42.    {
  43.        printf("The number of pokemon pidgeys that will be evolved is %d\n", evolvedPidgey=pidgeyPokemons);
  44.        printf("The number of pidgies that haven't evolved are %d \n", unevolvedPidgey=pidgeyPokemons-evolvedPidgey);
  45.        printf("The number of candy earned after evolved %d \n", evolvedCandy=evolvedPidgey);
  46.        printf("The number of candy left over is %d \n", candyLeft=pidgeyCandy+evolvedPidgey-(12 * evolvedPidgey));
  47.        printf("The maximum amount of XP points is %d \n", XP = evolvedPidgey * 2 * 500);
  48.    }
  49.    
  50.    else if (((pidgeyCandy-1)/11) < pidgeyPokemons)
  51.    {
  52.        printf("The number of pokemon pidgeys that will be evolved is %d\n", evolvedPidgey=(pidgeyCandy-1/11));
  53.        printf("The number of pidgies that haven't evolved are %d \n", unevolvedPidgey=pidgeyPokemons-evolvedPidgey);
  54.        printf("The number of candy earned after evolved %d \n", evolvedCandy=evolvedPidgey);
  55.        printf("The number of candy left over is %d \n", candyLeft=pidgeyCandy+evolvedPidgey-(12 * evolvedPidgey));
  56.        printf("The maximum amount of XP points is %d \n", XP = evolvedPidgey * 2 * 500);
  57.    }
  58.    
  59.    
  60.    else if (((pidgeyCandy-1)/11) == pidgeyPokemons)
  61.    {
  62.      printf("The number of pokemon pidgeys that will be evolved is %d\n", evolvedPidgey=pidgeyPokemons);
  63.        printf("The number of pidgies that haven't evolved are %d \n", unevolvedPidgey=pidgeyPokemons-evolvedPidgey);
  64.        printf("The number of candy earned after evolved %d \n", evolvedCandy=evolvedPidgey);
  65.        printf("The number of candy left over is %d \n", candyLeft=pidgeyCandy+evolvedPidgey-(12 * evolvedPidgey));
  66.        printf("The maximum amount of XP points is %d \n", XP = evolvedPidgey * 2 * 500);   
  67.    }
  68.      return 0
  69. }