Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace TishkataClass
- {
- class PersonalDiet
- {
- public string Gender { get; set; }
- public double Weight { get; set; }
- public int Height { get; set; }
- public int WorkoutPerWeek { get; set; }
- public PersonalDiet(string gender, double weight, int height, int workoutPerWeek)// KONSTRUKTOR
- {
- Gender = gender;
- Weight = weight;
- Height = height;
- WorkoutPerWeek = workoutPerWeek;
- }
- }
- class Program
- {
- static void Main(string[] args)
- {
- Console.WriteLine("Do you want to start working out?");
- string answer = Console.ReadLine();// yes или no
- if (answer == "yes")
- {
- Console.WriteLine("What gender are you?");//m ili f (m = male, f = female)
- string gender = Console.ReadLine();
- Console.WriteLine("How much do you weight?");
- double weight = double.Parse(Console.ReadLine());
- Console.WriteLine("How tall are you?(in cm)");
- int height = int.Parse(Console.ReadLine());
- Console.WriteLine("How many times do you workout or plan to workout every week?");
- int workoutTimes = int.Parse(Console.ReadLine());
- PersonalDiet person = new PersonalDiet(gender, weight, height, workoutTimes);
- Console.WriteLine("Type: '1' if you want to lose weight, '2' if you want to gain weight.");
- string secondAnswer = Console.ReadLine();
- if (secondAnswer == "1")
- {
- if (person.Gender == "m")
- {
- if (person.WorkoutPerWeek <= 3)
- {
- double caloriesPerDay = person.Weight * 30;
- 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.");
- }
- else if(person.WorkoutPerWeek > 3)
- {
- double caloriesPerDay = person.Weight * 33;
- 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.");
- }
- }
- else//ако е момиче
- {
- if(person.WorkoutPerWeek <= 3) {
- double caloriesPerDay = person.Weight * 28;
- 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.");
- }
- else if(person.WorkoutPerWeek > 3)
- {
- double caloriesPerDay = person.Weight * 30;
- 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.");
- }
- }
- }
- else//ako iska da gainva weight (всичко е почти същото като горния цикъл с weightloss-а
- {
- if (person.Gender == "m")
- {
- if (person.WorkoutPerWeek <= 3)
- {
- double caloriesPerDay = person.Weight * 30;
- 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.");
- }
- else if (person.WorkoutPerWeek > 3)
- {
- double caloriesPerDay = person.Weight * 33;
- 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.");
- }
- }
- else
- {
- if (person.WorkoutPerWeek <= 3)
- {
- double caloriesPerDay = person.Weight * 28;
- 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.");
- }
- else if (person.WorkoutPerWeek > 3)
- {
- double caloriesPerDay = person.Weight * 30;
- 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.");
- }
- }
- }
- }
- else//ако не иска, ем брат шанс
- {
- Console.WriteLine("That's really unfortunate. You are missing alot of fun!");
- return;//приключва програмата
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement