Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ConsoleApplication1
- {
- class Program
- {
- public static string GetStr(string a_sText)
- {
- Console.Write(a_sText);
- return Console.ReadLine();
- }
- public static int GetInt(string a_sText)
- {
- Console.Write(a_sText);
- return int.Parse(Console.ReadLine());
- }
- public static float GetFloat(string a_sText)
- {
- Console.Write(a_sText);
- return float.Parse(Console.ReadLine());
- }
- static void Main(string[] args)
- {
- Osoba osoba = new Osoba();
- while (true)
- {
- try
- {
- osoba.Imie = GetStr("Podaj Imie ");
- osoba.Nazwisko = GetStr("Podaj Nazwisko");
- osoba.Wiek = GetInt("Podaj wiek:");
- osoba.Waga = GetFloat("Podaj Wage");
- osoba.Wzrost = GetFloat("Podaj Wzros");
- Console.WriteLine(" Witam " + osoba.Imie + " Twoje BMI wynosi: " + osoba.Bmi);
- break;
- }
- catch (Exception e)
- {
- Console.WriteLine(e.Message);
- }
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement