Advertisement
didito33

Tishkata's Project

Dec 6th, 2021
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.55 KB | None | 0 0
  1. using System;
  2.  
  3. namespace TishkataClass
  4. {
  5. class PersonalDiet
  6. {
  7. public string Gender { get; set; }
  8. public double Weight { get; set; }
  9. public int Height { get; set; }
  10. public int WorkoutPerWeek { get; set; }
  11. public PersonalDiet(string gender, double weight, int height, int workoutPerWeek)// KONSTRUKTOR
  12. {
  13. Gender = gender;
  14. Weight = weight;
  15. Height = height;
  16. WorkoutPerWeek = workoutPerWeek;
  17. }
  18.  
  19. }
  20. class Program
  21. {
  22. static void Main(string[] args)
  23. {
  24. Console.WriteLine("Do you want to start working out?");
  25. string answer = Console.ReadLine();// yes или no
  26. if (answer == "yes")
  27. {
  28. Console.WriteLine("What gender are you?");//m ili f (m = male, f = female)
  29. string gender = Console.ReadLine();
  30. Console.WriteLine("How much do you weight?");
  31. double weight = double.Parse(Console.ReadLine());
  32. Console.WriteLine("How tall are you?(in cm)");
  33. int height = int.Parse(Console.ReadLine());
  34. Console.WriteLine("How many times do you workout or plan to workout every week?");
  35. int workoutTimes = int.Parse(Console.ReadLine());
  36.  
  37. PersonalDiet person = new PersonalDiet(gender, weight, height, workoutTimes);
  38.  
  39. Console.WriteLine("Type: '1' if you want to lose weight, '2' if you want to gain weight.");
  40. string secondAnswer = Console.ReadLine();
  41. if (secondAnswer == "1")
  42. {
  43. if (person.Gender == "m")
  44. {
  45.  
  46. if (person.WorkoutPerWeek <= 3)
  47. {
  48. double caloriesPerDay = person.Weight * 30;
  49. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be decreased to {(person.Weight * 25):f0} if you want to lose 0.5kgs per week.");
  50. }
  51. else if(person.WorkoutPerWeek > 3)
  52. {
  53. double caloriesPerDay = person.Weight * 33;
  54. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be decreased to {(person.Weight * 27):f0} if you want to lose 0.5kgs per week.");
  55. }
  56. }
  57. else//ако е момиче
  58. {
  59.  
  60. if(person.WorkoutPerWeek <= 3) {
  61. double caloriesPerDay = person.Weight * 28;
  62. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be decreased to {(person.Weight * 23):f0} if you want to lose 0.5kgs per week.");
  63. }
  64. else if(person.WorkoutPerWeek > 3)
  65. {
  66. double caloriesPerDay = person.Weight * 30;
  67. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be decreased to {(person.Weight * 25):f0} if you want to lose 0.5kgs per week.");
  68. }
  69.  
  70. }
  71. }
  72. else//ako iska da gainva weight (всичко е почти същото като горния цикъл с weightloss-а
  73. {
  74. if (person.Gender == "m")
  75. {
  76.  
  77. if (person.WorkoutPerWeek <= 3)
  78. {
  79. double caloriesPerDay = person.Weight * 30;
  80. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be increased to {(person.Weight * 35):f0} if you want to gain 0.5kgs per week.");
  81. }
  82. else if (person.WorkoutPerWeek > 3)
  83. {
  84. double caloriesPerDay = person.Weight * 33;
  85. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be increased to {(person.Weight * 37):f0} if you want to gain 0.5kgs per week.");
  86. }
  87. }
  88. else
  89. {
  90.  
  91. if (person.WorkoutPerWeek <= 3)
  92. {
  93. double caloriesPerDay = person.Weight * 28;
  94. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be increased to {(person.Weight * 33):f0} if you want to gain 0.5kgs per week.");
  95. }
  96. else if (person.WorkoutPerWeek > 3)
  97. {
  98. double caloriesPerDay = person.Weight * 30;
  99. Console.WriteLine($"Its normal for you to eat {caloriesPerDay:f0} every day, but that should be increased to {(person.Weight * 35):f0} if you want to gain 0.5kgs per week.");
  100. }
  101.  
  102. }
  103. }
  104.  
  105. }
  106. else//ако не иска, ем брат шанс
  107. {
  108. Console.WriteLine("That's really unfortunate. You are missing alot of fun!");
  109. return;//приключва програмата
  110. }
  111. }
  112. }
  113. }
  114.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement