<mosaic.cnfolio.com>
PROGRAM
1. /*START
2.    SCAN inputted numbers of pidgeys and number of candies
3.    carry out PRESENCE CHECK VALIDATION
4.       IF no data is inputted
5.          THEN
6.             DISPLAY ERROR message
7.       END IF
8.    carry out FORMAT CHECK VALIDATION and RANGE CHECK VALIDATION
9.       IF entered data is not whole positive numbers
10.          THEN
11.             DISPLAY ERROR message
12.       END IF
13.    check if the player has enough candys to evolve any pidgeys
14.       IF number of candies are less than twelve
15.          THEN
16.             DISPLAY ERROR message that says there aren't enough candies to evolve
17.       END IF
18.    calculate maximum possible amount of xp earned by evolving pokemon assuming there are 0 new pokedex entries
19.       IF the number of evolutions are less than the number of pidgeys
20.          THEN
21.             MULTIPLY the number of evolutions by one thousand as there aren't enough candies to evolve all of the pidgeys
22.                THEN
23.                   DISPLAY the calculated amount of xp from number of evolutions
24.          ELSE
25.             MULTIPLY the number of pidgeys by one thousand as there aren't enough pidgeys to use all of the available candy
26.                THEN
27.                   DISPLAY the calculated amount of xp from number of evolutions
28.       END IF
29. END*/
30.
31.
32. #include <stdio.h>
33. #include <ctype.h>
34. int main(void)
35. {
36.    int number1, number2;
37.    int presencecheck = scanf("%d %d",&number1, &number2);
38.    int numberofevolutions = number2/12.0;
39.
40.       if (presencecheck<1)
41.       {
42.          printf("Error! Invalid data, Please enter number of Pidgeys and Candies");
43.       }
44.       else
45.
46.       if (number1<1)
47.       {
48.          printf("Error! Please enter a valid number of pidgeys");
49.       }
50.       else
51.
52.       if (number2<1)
53.       {
54.       printf("Error! Please enter a valid number of candies");
55.       }
56.       else
57.
58.       if (number2<12)
59.       {
60.       printf("Im sorry, you don't have enough pidgey candy to evolve any pidgeys");
61.       }
62.       else
63.
64.       if (numberofevolutions<number1)
65.       {
66.       printf("The maximum number of XP you can gain is %.0fXP from %d evolutions", numberofevolutions * 1000.0, numberofevolutions);
67.       }
68.       else
69.       {
70.       printf("The maximum number of XP you can gain is %.0fXP from %d evolutions", number1 * 1000.0, number1);
71.       }
72.
73. }