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;
- namespace IziProgZH2
- {
- internal class Program
- {
- internal const string cuser = "gipszjakab";
- internal const string cpasswd = "alma";
- internal static void Main(string[] args)
- {
- string user = "";
- string pw = "";
- string pick = "";
- Console.WriteLine("Login with ur username/password");
- Console.WriteLine("User: ");
- user = Console.ReadLine();
- Console.WriteLine("Pw: ");
- pw = Console.ReadLine();
- while (user.ToLower() != cuser && pw.ToLower() != cpasswd)
- {
- Console.WriteLine("Invalid login data!");
- Console.WriteLine("User: ");
- user = Console.ReadLine();
- Console.WriteLine("Password: ");
- pw = Console.ReadLine();
- }
- Console.WriteLine("Successfully logged in! Type kör or négyzet");
- pick = Console.ReadLine();
- while (pick.ToLower() != "kör" && pick.ToLower() != "négyzet")
- {
- Console.WriteLine("Invalidpick!");
- Console.WriteLine("Type 'kör' or 'négyzet'");
- pick = Console.ReadLine();
- }
- string svalue;
- double dv;
- if (pick == "kör")
- {
- Console.WriteLine("Type the desired r to calculate with:");
- svalue = Console.ReadLine();
- bool b = double.TryParse(svalue, out dv);
- while (!b)
- {
- Console.WriteLine("Type the desired r to calculate with:");
- svalue = Console.ReadLine();
- b = double.TryParse(svalue, out dv);
- }
- Console.WriteLine("Calc: " + 3.14 * dv*dv);
- }
- else
- {
- Console.WriteLine("Type the desired a to calculate square's T with:");
- svalue = Console.ReadLine();
- bool b = double.TryParse(svalue, out dv);
- while (!b)
- {
- Console.WriteLine("Type the desired r to calculate with:");
- svalue = Console.ReadLine();
- b = double.TryParse(svalue, out dv);
- }
- Console.WriteLine("Calc: " + dv*dv);
- }
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement