<mosaic.cnfolio.com>
PROGRAM
1. /*
2.
3. START
4.
5. PRINT (Introduction to the programme.)
6.
7. PRINT (User should be notified
8. that, the programme calculates the Experience Points (XP) earned from evolving
9. either a Pidgey, Rattata or Zubat Pokemon, whilst using a lucky egg timer.).
10.
11. PRINT (Instruct user to enter 3 variables, in order of; the Pokemon type the user has, the number
12. of Pokemon the user has and the number of candies the user has.).
13.
14. For each of these variables, assign a name to thier input values:
15.    Assign the type of pokemon to be "poketype".
16.    Assign the number of Pokemon to be "pokenumb".
17.    Assign the number of candies to be "candynumb".
18.
19. PRINT (An example of an input).
20.
21. SCAN (Three input variables entered by the user, should now be scanned
22. and the values should be assigned to their respective name.)
23.
24. For the CASE that the user has Pidgey Pokemon:
25.
26. {
27.
28. First we need to calculate if the user has enough candies to evolve all Pidgey Pokemon.
29.
30. Call the minimum number of candies needed to evolve all Pidgey Pokemon "mincandy1".
31.
32. For this case "mincandy1" = (11 x "pokenumb") + 1.
33.
34. IF ("The number of candies the user has is more than or equal to "mincandies"")
35.    PRINT (The total XP gained from evolving all the Pidgey Pokemon the user has. Also
36.    give the number of canides left over after all the evolutions occur.).
37. For this case:   Maximum XP gained = number of evolutions possible * 1000.
38.                      Candies left over = "candynumb" - (pokenumb * 11)
39.
40.
41. IF ("The number of candies is more than or equal to 12, but less than "mincandy"")
42.       PRINT (The number of maximum amount of Pidgey the user will be able to evolve. Also print
43.       the maximum amount of XP earned.)
44. For this case:   Maximum XP gained = number of evolutions possible * 1000.
45.                      Maximum amount of Pidgey to evolve = ((candynumb - 12) / 11) +1.
46.
47. IF ("The number of candies is less than 12")
48.       PRINT ("You dont have enough candies to evolve any evolve even just 1 Pokemon.")
49.
50. IF ("The number of candies is 11 and has more than one Pokemon")
51.       PRINT (As this is a special case scenario, so advise the user to "transfer 1 Pokemon before using a
52. lucky egg timer, in order to evolve 1 Pokemon by only using 11 candies.")
53.
54.
55.
56. IF ("The the user enters negative inputs for the number of Pidgey Pokemon or Candy")
57.       PRINT (Error message. Explain that the user can not have negative numbers.)
58.
59. IF ("The user inputs are entered in a wrong format in terms of spacing")
60.       PRINT (Error Message. Explain what the user can do.)
61.
62. IF ("The user has not made best use of time.")
63.       PRINT (Recomendation to evolve more Pokemon)
64.
65. }
66.
67. For the CASE that the user has Rattata Pokemon:
68.
69. {
70.
71. First we need to calculate if the user has enough candies to evolve all Rattata Pokemon.
72.
73. Call the minimum number of candies needed to evolve all Rattata Pokemon "mincandy".
74.
75. For this case "mincandy2" = (24 x "pokenumb") + 1.
76.
77. IF ("The number of candies the user has is more than or equal to "mincandies"")
78.       PRINT (The total XP gained from evolving all the Rattata Pokemon the user has. Also
79.       give the number of canides left over after all the evolutions occur.).
80.       For this case:   Maximum XP gained = number of evolutions possible * 1000.
81.                      Candies left over = "candynumb" - (pokenumb * 24)
82.
83. IF ("The number of candies is more than or equal to 25, but less than "mincandy"")
84.       PRINT (The number of maximum amount of Rattata the user will be able to evolve. Also print
85.       the maximum amount of XP earned.)
86.       For this case:   Maximum XP gained = number of evolutions possible * 1000.
87.                      Maximum amount of Rattata to evolve = ((candynumb - 25) / 24) +1.
88.
89. IF ("The number of candies is less than 25")
90.       PRINT (You dont have enough candies to evolve any evolve even just 1 Pokemon.)
91.
92. IF ("The number of candies is 24 and has more than one Pokemon")
93.       PRINT (As this is a special case scenario, so advise the user to "transfer 1 Pokemon before using a
94.       lucky egg timer, in order to evolve 1 Pokemon by only using 24 candies.")
95.
96. IF ("The the user enters negative inputs for the number of Rattata Pokemon or Candy")
97.       PRINT (Error message. Explain that the user can not have negative numbers.)
98.
99. IF ("The user inputs are entered in a wrong format in terms of spacing")
100.       PRINT (Error Message. Explain what the user can do.)
101.
102. IF ("The user has not made best use of time.")
103.       PRINT (Recomendation to evolve more Pokemon)
104.
105.
106. }
107.
108. For the CASE that the user has Zubat Pokemon:
109.
110. {
111.
112. First we need to calculate if the user has enough candies to evolve all Zubat Pokemon.
113.
114. Call the minimum number of candies needed to evolve all Zubat Pokemon "mincandy".
115.
116. For this case "mincandy3" = (49 x "pokenumb") + 1.
117.
118. IF (The number of candies the user has is more than or equal to "mincandies")
119.       PRINT (The total XP gained from evolving all the Zubat Pokemon the user has. Also
120.       give the number of canides left over after all the evolutions occur.).
121.       For this case:   Maximum XP gained = number of evolutions possible * 1000.
122.                      Candies left over = "candynumb" - (pokenumb * 49)
123.
124. IF (The number of candies is more than or equal to 50, but less than "mincandy")
125.       PRINT (The number of maximum amount of Rattata the user will be able to evolve. Also print
126.       the maximum amount of XP earned.)
127.       For this case:   Maximum XP gained = number of evolutions possible * 1000.
128.                      Maximum amount of Zubat to evolve = ((candynumb - 50) / 49) +1.
129.
130. IF (The number of candies is less than 50)
131.       PRINT (You dont have enough candies to evolve any evolve even just 1 Pokemon.)
132.
133. IF ("The number of candies is 49 and has more than one Pokemon")
134.       PRINT (As this is a special case scenario, so advise the user to "transfer 1 Pokemon before using a
135. lucky egg timer, in order to evolve 1 Pokemon by only using 49 candies.")
136.
137. IF (The the user enters negative inputs for the number of Zubat Pokemon or Candy)
138.       PRINT (Error message. Explain that the user can not have negative numbers.)
139.
140. IF ("The user inputs are entered in a wrong format in terms of spacing")
141.       Print (Error Message. Explain what the user can do.)
142. }
143.
144. FINISH
145.
146. */
147.
148. #include <stdio.h>
149.
150. /* The code in line 148 tells the compiler to include the source code from the "stdio.h" header file, into this programme.
151.    It is also known as a preprocessor directive. */
152.
153.
154. int main (void)
155.
156. /* Line 154 is simply a default entry point for the programme. It signifies where the programme starts.
157.    This needs to be define before any other function is defined */
158.
159.
160. {                             /* The "main" function starts here. */
161.
162.
163. /* "printf" is used here to print an introduction to the calculator, into the standard output. */
164.    printf("************************************************\n\n");
165.    printf("Welcome to this Pokemon GO Lucky Egg Calculator.\n");
166.    printf("It will calculate maximum Experience Points (XP) gained from Pidgey,\n");
167.    printf("Rattata or Zubat Pokemon evolutions while using a lucky egg.\n\n");
168.    printf("************************************************\n\n");
169.
170. /* The "\n" is an example of an escape sequence. It allows for printed outputs to be formatted in a structured way.
171.    In this case, "\n" allows the subsequent output to be printed on a new line. */
172.
173.    printf("To start, please follow these instructions:\n\n"); /* Within C, a semicolon is used to signify the termination of a simple statement. It helps the compiler know when any given simple statment ends. */
174.
175.    printf("First, you need to enter what type of Pokemon you have.\n");
176.    printf("If you have Pidgey Pokemon - enter the letter p.\n");
177.    printf("If you have Rattata Pokemon - enter the letter r.\n");
178.    printf("If you have Zubat Pokemon - enter the letter z.\n");
179.    printf("This input needs to be in lower case form.\n\n");
180.
181.
182.    printf("Second, you need to enter how many Pokemon of the stated type you have.\n\n");
183.
184.
185.    printf("Finally, you need to enter how many candies you have.\n\n");
186.
187.    printf("You will need to enter this information into the input box.\n");
188.
189.    printf("For example, If you had 5 Zubat Pokemon and 16 candies - you would enter as follows:\n\n");
190.    printf("z 5 16\n\n");
191.    printf("Just leave 1 character space in between each entry.\n\n");
192.
193.    printf("Or, you could enter it like this:\n");
194.    printf("z\n");
195.    printf("5\n");
196.    printf("16\n\n");
197.    printf("Each entry, in this case, should be in its own line.\n\n");
198.
199.    printf("************************************************\n");
200.    printf("************************************************\n\n");
201.    printf("The results will be displayed below.\n");
202.    printf("Please ignore Error Message 1.1 when you first start the programme.\n\n");
203.    printf("************************************************\n");
204.    printf("************************************************\n\n");
205.
206. /*
207.
208.    The first objective of the programme is to establish what type of Pokemon the user has, how many of the stated type they have and the number of candy held.
209.
210.    The prerequisite for this is the need to define a few variables.
211.
212.    This will help us to distinguish between different inputs and outputs.
213.
214.
215. */
216.
217.
218.
219.     char poketype;      /* The programme's first variable is to be assigned the name "poketype".
220.                            Poketype will signify what king of Pokemon the user has.
221.                            "char" is known as the data type, which in this case is a character. */
222.
223.
224.     int pokenumb = 0;   /* The second information the program needs to be established is the number of pokemon of the stated type obtained by the user.
225.                      As a result, for the data identifier, "pokenumb" is written.
226.                     For this case, we use the data type "int",
227.                            it signifies that the data will consist of an integer value. */
228.
229.     int candynumb = 0/* "candynumb" is a variable that denotes the number of candies the user has.
230.
231.
232.                      For the variables "pokenumb" and "candynumb", they have been initialised to 0.
233.                            This wil help define parameters for certain potential errors that can crop up from the user end. */
234.
235.     scanf("%c", &poketype);   /* The first input in the standard input will be read and the value will be assigned to the variable "poketype".
236.                The purpose for this is to establish what kind of Pokemon the user has. */
237.
238.
239.     scanf("%d %d", &pokenumb, &candynumb); /* This simple statement follows the same characteristics as the one above.
240.                                               However, the "%d" tells the programme that it should expect to read integer values.
241.                                               Essentially, the second and third values entered by the user will be read and assigned
242.                                               to the defined variables "pokenumb" and "candynumb", respectively.
243.
244.                                               It is important to note that, "pokenumb" and "candynumb" at first, have the value zero, as they were initialised to this value.
245.                                               But, once the programme reads the second and third values from the standard input, it will overide these intitial values
246.                                               and replace them with the new values which have been read. (The reason for doing this will be illustrated below).
247.                                               */
248.
249. /* Once the programme has these variables, the next step for it is to calculate how many Pokemon can be evolved in each individual case. */
250.
251.     int mincandy1 = ((11 * pokenumb) + 1)/* "mincandy1" is the minimum amount of candies needed to evolve all Pidgey Pokemon that the user has */
252.
253.     int mincandy2 = ((24 * pokenumb) + 1)/* "mincandy2" is the minimum amount of candies needed to evolve all Rattata Pokemon that the user has */
254.
255.     int mincandy3 = ((49 * pokenumb) + 1)/* "mincandy3" is the minimum amount of candies needed to evolve all Zubat Pokemon that the user has */
256.
257. /* If the user has enough candies to evolve all pokemon, we need to work out how much XP they will earn in total. */
258.
259.     int xp1 = pokenumb * 1000;              /* Total XP is given by multiplying the number of Pokemon the user has by 1000. */
260.
261.
262. /* Then we need to work out how much candy the user has left over, once they evolve all Pokemon of each individual type. */
263.
264.     int candyleft1 = candynumb - (mincandy1 - 1)/* "candyleft1" is the amount of candy left over after evolving all Pidgey Pokemon. */
265.     int candyleft2 = candynumb - (mincandy2 - 1)/* "candyleft2" is the amount of candy left over after evolving all Rattata Pokemon. */
266.     int candyleft3 = candynumb - (mincandy3 - 1)/* "candyleft3" is the amount of candy left over after evolving all Zubat Pokemon. */
267.
268. /* The formulas from line 245 to line 261 only apply to the hypothetical situation where the user has enough candies to evolve all Pokemon they hold */
269.
270.
271.
272.
273.
274. /* In the situation that the user doesn't have enough candies to evolve all Pokemon, the programme needs to calculate the maximum number of evolutions possible. */
275.
276.
277.
278.     int evolvenumb11 = ((candynumb - 12) / 11) + 1; /* "evolvenumb11" is the value given to the maximum number of Pidgey evolutions possible, factoring in the number of candies held by the user. */
279.
280.     int xp11 = evolvenumb11 * 1000; /* Once the program has calculated the maximum amount of Pidgey evolutions possible, it will calculate the XP earnt from these evolutions. */
281.
282.
283.
284.     int evolvenumb12 = ((candynumb - 25) / 24) + 1; /* "evolvenumb12" is the value given to the maximum number of Rattata evolutions possible, factoring in the number of candies held by the user. */
285.
286.     int xp12 = evolvenumb12 * 1000; /* Once the program has calculated the maximum amount of Rattata evolutions possible, it will calculate the XP earnt from these evolutions. */
287.
288.
289.
290.     int evolvenumb13 = ((candynumb - 50) / 49) + 1; /* "evolvenumb13" is the value given to the maximum number of Zubat evolutions possible, factoring in the number of candies held by the user. */
291.
292.     int xp13 = evolvenumb13 * 1000; /* Once the program has calculated the maximum amount of Zubat evolutions possible, it will calculate the XP earnt from these evolutions. */
293.
294.
295.
296. /* Now that the program has calculated the relevant data, it needs to present the results to the user.
297.    However to ensure only the relevant data is printed onto the standard output, a switch statement is needed to account for the users choice of Pokemon.
298. */
299.
300.      switch(poketype)  /* A switch statemnt is helpful to execute the correct code needed for each respective situation. */
301.
302.     {
303.         case 'p':     /* In the case that the "poketype" variable is equal to "p" (meaning that the user has Pidgey Pokemon), this block of code, encased by a set of curly braces, will be executed. No other lines in this switch statement will be executed. */
304.
305.            if (pokenumb == 0){
306.            if (candynumb == 0){
307.            printf("Error! You have not entered the amount of Pidgey Pokemon you have and the amount of candies you have.\n");
308.            }
309.            } /* If both the "pokenumb" and at the same time, the "candynumb" values remain initialised to zero, it means that the user has not entered anything to overide these values. Hence, when this condition is met an error message will be printed. */
310.              /* The error message will only be printed when both the if statement conditions are met. */
311.
312.
313.            if (candynumb == 0){
314.            printf("Error! You have entered the information incorrectly. It is likely that you\nhaven't used the correct spacing between each variable as specified.\nPlease read input instructions situated above.\n");
315.            } /* If the "candynumb" value on is equal to zero, it is likely that the user has not seperated thier inputs in the standard input. So an error message wll be printed if this condition is met. */
316.
317.
318.            if (candynumb < 0){
319.            printf("Error! You have entered a negative number for the amount of candies you have. This needs to be positive.\n");
320.            } /* It is impossible to have a negative amount of candies. Hence when the value of "candynumb" is less than zero, an error message will be printed. */
321.
322.            if (pokenumb < 0){
323.            printf("Error! You have entered a negative number for the amount of Pidgey Pokemon you have. This needs to be positive.\n");
324.            } /* This follows the same principles as the statement in line 313. */
325.
326.            if (pokenumb > 0){
327.            if (candynumb >= mincandy1){
328.            printf("You will be able to evolve all Pidgey Pokemon you have.\n");
329.            printf("You will earn %d XP from evolving %d Pidgey Pokemon.\n", xp1, pokenumb);
330.            printf("Once you evolve all Pokemon, you will be left with %d candies.\n\n", candyleft1);
331.            printf("You will take around %.1f minutes to evolve all pokemon.\n", 0.5 *  pokenumb);
332.            if ((0.5 * pokenumb) > 30){
333.            printf("Hence you will need to use more than one lucky egg timer.");
334.            }
335.            if ((0.5 * pokenumb) < 20) {
336.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (40 - pokenumb));
337.            }
338.            }
339.            }/* If the user has enough candies to evolve all Pokemon and at the same time, the value of "Pokenumb" is more than 0, the printf function will be executed. */
340.              /* Only when these two conditions are met, will the printf functions be executed. */
341.
342.
343.            if (candynumb >= 12){
344.            if (candynumb < mincandy1){
345.
346.            printf("Assuming you don't transfer any Pokemon before activating your Lucky Egg:\n\n");
347.            printf("You will be able to evolve %d Pidgey Pokemon out of the %d you have, earning you %d XP.\n", evolvenumb11, pokenumb, xp11);
348.            printf("You will be left with %d candies.\n\n",(candynumb - (evolvenumb11 * 11)));
349.            printf("You will take around %.1f minutes to evolve the pokemon.\n", 0.5 *  evolvenumb11);
350.            if ((0.5 * evolvenumb11) > 30){
351.            printf("Hence you will need to use more than one lucky egg timer.");
352.            }
353.            if ((0.5 * evolvenumb11) < 20) {
354.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (20 - evolvenumb11));
355.            }
356.            }
357.            } /* If the user has more than 12 candies but less than the threshold amount to evolve all Pokemon only some Pokemon will be able to evolve, the programme will use "evolvenumb11" and "xp11" rather than "xp1" as there will be some unevolved Pokemon left over. */
358.
359.
360.            if (candynumb > 0){
361.            if (candynumb < 11){
362.            printf("You dont have enough candies to evolve 1 Pidgey.\n");
363.            printf("You need atleast %d more candies to evolve a minimum of 1 Pidgey Pokemon", (12 - candynumb));
364.            }
365.            } /* If the number of candies is between 0 and 11, the user won't have enough candies to evolve even 1 Pokemon. */
366.
367.
368.            if (candynumb == 11){
369.            if (pokenumb >= 1){
370.            printf("This is a special case scenario. As you only have 11 candies but multiple Pidgey Pokemon.\n");
371.            printf("We advise you to transfer 1 pokemon before activating your lucky egg.\n");
372.            printf("This will enable you to evolve only 1 Pidgey earning you 1000XP.");
373.            }
374.            } /* If the user only has 11 candies while having more than 1 Pokemon, he can transfer a Pokemon for a candy and thus be able to evolve 1 Pokemon. */
375.
376.
377.
378.
379.            break; /* This break is needed to act as an exit point for the programme once it has complied the above code. So that no more of the following codes are executed. */
380.
381.
382.
383.
384. /* From now, the source code follows the same characteristics as explained above. */
385.
386.
387.
388.
389.            case 'r':     /* In the case that the "poketype" variable is equal to "r" (meaning that the user has Rattata Pokemon), this block of code will be executed. */
390.
391.            if (pokenumb == 0){
392.            if (candynumb == 0){
393.            printf("Error! You have not entered the amount of Rattata Pokemon you have and the amount of candies you have.\n");
394.            }
395.            }
396.
397.            if (candynumb == 0){
398.            printf("Error! You have entered the information incorrectly. It is likely that you\nhaven't used the correct spacing between each variable as specified.\nPlease read input instructions situated above.\n");
399.            }
400.
401.            if (pokenumb == 0){
402.            printf("Error! You have entered the information incorrectly.\nIt is likely that you haven't used the correct spacing between each variable as specified.\nPlease read input instructions situated above.\n");
403.            }
404.
405.            if (candynumb < 0){
406.            printf("Error! You have entered a negative number for the amount of candies you have. This needs to be positive.\n");
407.            }
408.
409.            if (pokenumb < 0){
410.            printf("Error! You have entered a negative number for the amount of Rattata Pokemon you have. This needs to be positive.\n");
411.            }
412.
413.            if (pokenumb > 0){
414.            if (candynumb >= mincandy2){
415.            printf("You will be able to evolve all Rattata Pokemon you have.\n");
416.            printf("You will earn %d XP from evolving %d Rattata Pokemon.\n", xp1, pokenumb);
417.            printf("Once you evolve all Pokemon, you will be left with %d candies.\n\n", candyleft2);
418.            printf("You will take around %.1f minutes to evolve all pokemon.\n", 0.5 *  pokenumb);
419.            if ((0.5 * pokenumb) > 30){
420.            printf("Hence you will need to use more than one lucky egg timer.\n");
421.            }
422.            if ((0.5 * pokenumb) < 20) {
423.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (40 - pokenumb));
424.            }
425.            }
426.            }
427.
428.            if (candynumb >= 25){
429.            if (candynumb < mincandy2){
430.
431.            printf("Assuming you don't transfer any Pokemon before activating your Lucky Egg:\n\n");
432.            printf("You will be able to evolve %d Rattata Pokemon out of the %d you have, earning you %d XP.\n", evolvenumb12, pokenumb, xp12);
433.            printf("You will be left with %d candies.\n\n",(candynumb - (evolvenumb12 * 24)));
434.            printf("You will take around %.1f minutes to evolve the pokemon.\n", 0.5 *  evolvenumb12);
435.            if ((0.5 * evolvenumb12) > 30){
436.            printf("Hence you will need to use more than one lucky egg timer.");
437.            }
438.            if ((0.5 * evolvenumb12) < 20) {
439.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (20 - evolvenumb12));
440.            }
441.            }
442.            }
443.
444.
445.            if (candynumb > 0){
446.            if (candynumb < 24){
447.            printf("You dont have enough candies to evolve 1 Rattata.\n");
448.            printf("You need atleast %d more candies to evolve a minimum of 1 Rattata Pokemon", (25 - candynumb));
449.            }
450.            }
451.
452.
453.            if (candynumb == 24){
454.            if (pokenumb >= 1){
455.            printf("This is a special case scenario. As you only have 24 candies but multiple Rattata Pokemon.\n");
456.            printf("We advise you to transfer 1 pokemon before activating your lucky egg.\n");
457.            printf("This will enable you to evolve only 1 Rattata earning you 1000XP.");
458.            }
459.            }
460.
461.
462.
463.            break;
464.
465.
466.
467.
468.
469.            case 'z':  /* In the case that the "poketype" variable is equal to "z" (meaning that the user has Zubat Pokemon), this block of code will be executed. */
470.
471.            if (pokenumb == 0){
472.            if (candynumb == 0){
473.            printf("Error! You have not entered the amount of Zubat Pokemon you have and the amount of candies you have.\n");
474.            }
475.            }
476.
477.            if (candynumb == 0){
478.            printf("Error! You have entered the information incorrectly. It is likely that you\nhaven't used the correct spacing between each variable as specified.\nPlease read input instructions situated above.\n");
479.            }
480.
481.            if (pokenumb == 0){
482.            printf("Error! You have entered the information incorrectly.\nIt is likely that you haven't used the correct spacing between each variable as specified.\nPlease read input instructions situated above.\n");
483.            }
484.            if (candynumb < 0){
485.            printf("Error! You have entered a negative number for the amount of candies you have. This needs to be positive.\n");
486.            }
487.
488.            if (pokenumb < 0){
489.            printf("Error! You have entered a negative number for the amount of Zubat Pokemon you have. This needs to be positive.\n");
490.            }
491.
492.            if (pokenumb > 0){
493.            if (candynumb >= mincandy3){
494.            printf("You will be able to evolve all Zubat Pokemon you have.\n");
495.            printf("You will earn %d XP from evolving %d Zubat Pokemon.\n", xp1, pokenumb);
496.            printf("Once you evolve all Pokemon, you will be left with %d candies.\n\n", candyleft3);
497.            printf("You will take around %.1f minutes to evolve all pokemon.\n", 0.5 *  pokenumb);
498.            if ((0.5 * pokenumb) > 30){
499.            printf("Hence you will need to use more than one lucky egg timer.");
500.            }
501.            if ((0.5 * pokenumb) < 20) {
502.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (40 - pokenumb));
503.            }
504.            }
505.            }
506.
507.            if (candynumb >= 50){
508.            if (candynumb < mincandy3){
509.
510.            printf("Assuming you don't transfer any Pokemon before activating your Lucky Egg:\n\n");
511.            printf("You will be able to evolve %d Zubat Pokemon out of the %d you have, earning you %d XP.\n", evolvenumb13, pokenumb, xp13);
512.            printf("You will be left with %d candies.\n\n",(candynumb - (evolvenumb13 * 49)));
513.            printf("You will take around %.1f minutes to evolve the pokemon.\n", 0.5 *  evolvenumb13);
514.            if ((0.5 * evolvenumb13) > 30){
515.            printf("Hence you will need to use more than one lucky egg timer.");
516.            }
517.            if ((0.5 * evolvenumb13) < 20) {
518.            printf("To make best use of your lucky egg timer, it is recommended that you evolve %d more pokemon.", (20 - evolvenumb13));
519.            }
520.            }
521.            }
522.
523.
524.            if (candynumb > 0){
525.            if (candynumb < 49){
526.            printf("You dont have enough candies to evolve 1 Zubat.\n");
527.            printf("You need atleast %d more candies to evolve a minimum of 1 Zubat Pokemon", (50 - candynumb));
528.            }
529.            }
530.
531.
532.            if (candynumb == 49){
533.            if (pokenumb >= 1){
534.            printf("This is a special case scenario. As you only have 49 candies but multiple Zubat Pokemon.\n");
535.            printf("We advise you to transfer 1 Pokemon before activating your lucky egg.\n");
536.            printf("This will enable you to evolve only 1 Zubat earning you 1000XP.");
537.            }
538.            }
539.
540.
541.
542.             break;
543.
544.
545.
546.             default:   /* If "poketype" is not equal to "p", "r" or "z", by the lines below will execute. */
547.
548.
549.             printf("Error Message 1.1: This Error Message has come up for either of two reasons:\n\n");
550.             printf("1 - Either, you have entered the letter for your Pokemon choice in upper case form.\n");
551.             printf("Please remember, all inputs should be in lower case.\n");
552.
553.             printf("2 - Or, you have entered a wrong letter for your Pokemon choice. \n");
554.             printf("Please remember, this programme only supports Pidgey (p), Rattata (r) or Zubat (z).\n\n");
555.
556.
557.
558. }
559.
560. return 0;
561.
562.  }