<mosaic.cnfolio.com>
PROGRAM
  1. //*******************************************************************************************//
  2. //** 07/01/2017   Kunalan Kamalakaran    ENG421-Introduction to Algorithims and Programming *//
  3. //**                                             Online Coursework 1                        *//
  4. //*******************************************************************************************//
  5.  
  6. #include <string.h>
  7. #include <stdio.h>
  8.  
  9. int main(void)
  10.  
  11. {
  12. int pidgey1, candy2, subtract, addition, multiply;
  13. float division;
  14.  
  15. /*Start If(pidgey is 1<x)*/
  16. /*Display Error!!!*/
  17. /*Then*/
  18. /*If(pidgey is x>1) */
  19. //*display no.pidgey within inventory */
  20. /* End if */
  21.  
  22. /*If(pidgey candy is 1<y)*/
  23. /*Display Error!!!*/
  24. /*Then*/
  25. /*If (pidgey candy is x>1)*/
  26. /*Display no.pidgey candies*/
  27.  
  28.  
  29. scanf( "%d %d", &pidgey1, &candy2);
  30. printf("The number of pidgey caught is %d.\n", pidgey1);
  31. printf("The number of candy is %d.\n" , candy2);
  32.  
  33.  
  34.  
  35. /**Evolution to evolve pidgey (without lucky egg)**/
  36.  
  37. /*scanf( "%d",&candy2);*/
  38. subtract = /*"%d,&candy2"*/  candy2 - 1;
  39. addition = /*"%d,subtract"*/ subtract + 500;
  40. /*divide = addition /4;*/
  41. division = (addition / 4);
  42.  
  43. division = ((candy2 - 1) + 500) / 4.0;
  44.  
  45.  
  46. printf("The player without lucky egg will recieve %f XP.\n", division);       
  47. /*printf("Candy2: %d, Subtract: %d, Addition: %d, Division: %d, Calc: %d",
  48. candy2, subtract, addition, division, (addition / 4));*/
  49.  
  50. /** Evolution to evolve (with lucky egg)**/
  51.  
  52. /*scanf( "%d",&candy2);*/
  53. subtract = /*"%d,&candy2"*/  candy2 - 1;
  54. multiply = /*"%d,subtract"*/ subtract * 1000;
  55. /*divide = multiply /4;*/
  56. division = (multiply / 4);
  57.  
  58. division = ((candy2 - 1) * 1000) / 4.0;
  59.  
  60. printf("The player with lucky egg recieve %f XP.\n", division);       
  61. /*printf("Candy2: %d, Subtract: %d, multiply: %d, Division: %d, Calc: %d",
  62. candy2, subtract, addition, division, (multiply / 4));*/
  63.  
  64. }