<mosaic.cnfolio.com>
PROGRAM
  1. /*
  2. START
  3. Set Values of Candies to Zero
  4. Set Values of Pidgeys to zero
  5. Set Values of XP to zero
  6. Read user input for Pidgeys
  7. Read User input for Candies
  8.  
  9. IF values for Candies is equil to or less than 0
  10. { THEN
  11.        Display error message "Unfortunately you do not have the correct amount of Candies required for this selected evolution"
  12.        END IF}
  13.        
  14. IF values for Pidgeys is less than 11
  15. { THEN
  16.        Display error message"Unfortunately you do not have the correct amount of Pidgeys requird for this selected evolution"
  17.        END IF}
  18.    
  19. IF all Values are correct
  20. { THEN
  21.       calculate amount of XP
  22.                            Display "The ammount of XP you have attained is"
  23.                            END IF}
  24. END
  25. */
  26. #include <stdio.h>
  27. int main (void)/*Here I have stated that I will be using Integers, it ensures that the code will search for whole numbers during calculations*/
  28. {
  29. int Pidgeys;
  30. int Candies;
  31. /*Here I have declared both of my variables in the form of Pidgeys and Candies*/
  32. int EvolveCandies=12;
  33. /*Here I have stated how many Candies are needed for a succesfull evolution*/
  34. int XP=1000;
  35. /*For each succesfull evolution the player will gain 1000 experience points or XP for short*/
  36. scanf("%d%d",&Pidgeys,&Candies);
  37. /*The Scanf function tells the program what two variables to search for, when making calculaions*/
  38. {
  39. }
  40. switch(Pidgeys)
  41. { case 0:
  42. printf("Unfortunately yuu do not have the correct amount of Pidgeys for a succcesfull evolution");
  43. default:
  44. break;
  45. /*Here is where my error message for having an incorrect Pidgey count will be, I decided to use a switch as opposed toi the conventional IF statement as it guarantees quality and checks for Errors*/
  46. }
  47. switch(Candies)
  48. {case 11: case 10: case 9: case 8: case 7: case 6: case 5: case 4: case3: case 2: case 1: case 0:
  49. printf("Unfortunately you do not posses the correct amount of candies for a succesfull evolution");
  50. default:
  51. break;
  52. /*Here is where my error message for having an inacurate amount of Candies*/
  53. }
  54. if (Candies >= Pidgeys*EvolveCandies)
  55. {
  56. printf("The total amount of XP attained by this Evolution is %d", (EvolveCandies*Pidgeys)/EvolveCandies*XP);
  57. /*Here is where my calculation for the total amout of XP takes place*/
  58. }
  59. else
  60. {
  61. printf("the Total amount of XP attained is %d", Candies/EvolveCandies*XP);
  62. }
  63. }