<mosaic.cnfolio.com>
PROGRAM
1. /*
2. Start
3. requires two inputs
4. checks inputs
5. collects input
6. checks if collected data is less than 12 pidgey_candy or less than 1 pidgey
7. IF date does not correspond
8.     prints messaged saying it cant evolve
9. END IF
10. IF date is more than 12 pidgey_candy or more than 1 pidgey
11.    program will work out how many times you can evolve
12.      prints message saying how many times
13. IF evolved pokemon is evolved it will display total xp gained and candy remaainig
14.      prints message stating how mauch xp you gained and how much candy remaining
15. END IF
16. END
17. */
18.
19. #include<stdio.h>
20. int main (void)
21.  {
22.
23.
24. int pidgey;                                                   //stores integrers
25. int pidgey_candy;
26. int Xp_luckyegg = 2000;                                        //everytime you evolve you gain 2000 XP
27. int pidgeotto;
28. int max_xp;
29. int XP;
30.
31. scanf("%d %d", &pidgey, &pidgey_candy);                       //Scans in the intergers from the input data box and stores the values above to the correct names
32.
33.
34.
35.
36.  if (pidgey_candy<12 || pidgey<1 )                            //if pidgey candy is less than 12 and pidgey is less than 1, it will print the message below in the Prinf statement
37.
38. printf("You cannot evolve any pidgeys\n");
39.
40.
41.     if (pidgey_candy>11 && pidgey>0 )                          //if pidgey candy is more than 11 and pidgey is more than 1 it will evolve into pidgeotto
42.    {
43.    pidgeotto = pidgey_candy/12;                               //once evolved into pidgeotto it will divide the amount of pidgey candy by 12 to tell you how many times you can evolve
44.    printf("You can evolve %d time(s)\n", pidgeotto);          //This printf statement will tell you how many times you can evolve, the /n means to start a new line
45.    }
46.
47.
48.       if (pidgeotto>0)                                         //if pidgeotto evolves more than once, it will multiply the amount of times it has evolved by 2000 to give you the amount og XP gained
49.      {
50.      XP = pidgeotto * Xp_luckyegg;                            //generates amount of XP by multiplying the amount of pidgeotto by luckyegg which is 2000
51.      printf("The amounte of XP gained is %d\n", XP);
52.      printf ("you have %d candy remaining\n", pidgey_candy-12*pidgeotto);      //Prints out how many candys you have remainng by subtracting 12 from pidgey_candy and then multiplying by amount of pidgeotto
53.      }
54.
55.
56. }