<mosaic.cnfolio.com>
PROGRAM
1. /*PSEUDO CODE
2. START
3.
4.
5.     Set the Pidgeys
6.     Set the Candies
7.     Set the Candies required for evo = 12
8.     Set the EvolutionCount
9.     Set the EvoCount
10.     Set the Evolution time = 21 seconds
11.     Set the NoLckyEggXp
12.     Set the LckyEggXp
13.     Set the TotalEvoTime
14.
15.     IF Pidgeys < 0 OR Candis < 12   -IF condition is true will show the error
16.       THEN
17.        PRINT Catch some more Pidgeys to evolve  -this is the error
18.         ELSE
19.          WHILE Pidgeys >= 1 AND Candis >= 12  will repeat until the condition is false
20.            DECREASE with one Pidgeys for each evo
21.            INCREASE with one the counters for each evo
22.            INCREASE with one Candis for each evo
23.            DECREASE the Candis from 12 candies that you need to evo
24.            NoLckyEgg is equal number evo multiplied by 500 Xp
25.            UseLckyEgg is equal number evo multiplied by 1000 Xp
26.            TotalTime per evo equal number evo multiplied by 21sec devided by 60sec
27.             THEN
28.               PRINT No. of Pidgeys can evo
29.               PRINT Xp earned not using LckyEgg
30.               PRINT Xp earned using LckyEgg
31.               PRINT the numbers of evo/s and time
32.               PRINT the numbers of Pidgeys and Candies left over from evo
33.            END WHILE
34.     END IF
35.
36. END
37. */
38.
39. #include <stdio.h>
40.
41.
42. int main(void)
43.
44. {
45.
46. int Pidgeys;
47. int Candies;
48. int NeedCandiesEvo = 12;/*Numbers of candies required to evolve*/
49. float EvolutionCount;   /*Counter float*/
50. int EvoCount; /*Counter integer*/
51. int EvolutionTime = 21; /*21 seconds per evo*/
52. int NoLuckyEggEvolutionXP; /*Xp earned by not using LuckyEgg*/
53. int LuckyEggEvolutionXP; /*Xp earned by using Lucky Egg*/
54. float TotalEvoTime; /*Total time of evolutions*/
55.
56.
57.
58.    {
59.     scanf("%d %d" ,&Pidgeys, &Candies ); /* the 2 inputs you are introducing  */
60.    }
61.
62.     if(Pidgeys < 0  || Candies < 12)  /* statement 'if'  the condition is true the Error will be shown  */
63.      {
64.        printf("ERROR-->Catch some more Pidgeys in order to be able to evolve!!"); /*The Error*/
65.      }
66.
67.     else
68.        {
69.         while(Pidgeys >=1 && Candies >= 12) /* this condition will be looped until the condition is false*/
70.
71.        {
72.
73.        Pidgeys--; /*Pidgeys will decrease by each evolution*/
74.        EvolutionCount++; /*The numbers of evolution will increase by 1 for each evo*/
75.        EvoCount++;
76.        Candies++; /*Gain 1 candy per evolution*/
77.        Candies -= NeedCandiesEvo; /*Candies you've introduced will be decreased by 12*/
78.        NoLuckyEggEvolutionXP = EvolutionCount * 500; /*This will show the Xp that you'll earn without using the LuckyEgg*/
79.        LuckyEggEvolutionXP = EvolutionCount * 1000; /*This will show the Xp that you'll earn using the LuckyEgg*/
80.        TotalEvoTime = EvolutionCount * 21/60; /* This shows how many minutes the evolutions will take*/
81.
82.
83.        }
84.
85.
86.          /*Display the results*/
87.
88.          printf("You will be able to evolve %d Pidgeys.\n",EvoCount);
89.
90.          printf("Without using your Lucky Egg you would gain %d XP.\n",NoLuckyEggEvolutionXP);
91.
92.          printf("Using your Lucky Egg you will gain %d XP.\n",LuckyEggEvolutionXP);
93.
94.          printf("On average, doing %d evolution/s it will take %.2f minutes to evolve your Pidgeys\n",EvoCount,TotalEvoTime);
95.
96.          printf("You will have %d Pidgeys left and %d Candies left from evolution.\n" ,Pidgeys, Candies);
97.
98.
99.
100.
101.        }
102.
103.
104. }