Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- int saldo = 0;
- static void Main(string[] args)
- {
- LogInMenu();
- }
- static void LogInMenu()
- {
- Console.WriteLine("\nVälkommen till Banken!");
- Console.WriteLine("[1] Skapa nytt konto");
- Console.WriteLine("[2] Avsluta");
- Console.Write("\nVälj: ");
- int option = Convert.ToInt32(Console.ReadLine());
- if (option == 1)
- {
- UserCreateAccount();
- }
- else if (option == 2)
- {
- Environment.Exit(0);
- }
- }
- static void UserCreateAccount()
- {
- Console.Clear();
- Console.Write("Förnamn: ");
- string userfirstname = Console.ReadLine();
- Console.Write("Efternamn: ");
- string userlastname = Console.ReadLine();
- Console.Write("Telefonnummer: ");
- string userphonenumber = Console.ReadLine();
- Console.Write("Kortnummer: ");
- string usercardnummer = Console.ReadLine();
- MainMenu(userfirstname, userlastname);
- }
- static void MainMenu(string userfirstname, string userlastname)
- {
- Console.Clear();
- Console.WriteLine("\nVälkommen " + userfirstname + " " + userlastname + "!");
- Console.WriteLine("[1] Sätt in pengar");
- string deposit = Console.ReadLine();
- Console.WriteLine("[2] Ta ut pengar");
- string withdraw = Console.ReadLine();
- Console.WriteLine("[3] Kontosaldo");
- string balance = Console.ReadLine();
- Console.WriteLine("[4] Avsluta");
- Console.Write("\nVälj: ");
- int option = Convert.ToInt32(Console.ReadLine());
- if (option == 1)
- {
- insättning();
- }
- else if (option == 2)
- {
- uttagning();
- }
- else if (option == 3)
- {
- kontosaldo();
- }
- else if (option == 4)
- {
- Environment.Exit(0);
- }
- }
- static void insättning()
- {
- int deposit;
- Console.WriteLine("Hur mycket pengar vill du sätta in: ");
- deposit = balance + deposit;
- }
- static void uttagning()
- {
- int withdraw;
- Console.WriteLine("Hur mycket pengar vill du ta ut: ");
- withdraw = balance - withdraw;
- }
- static void kontosaldo()
- {
- int balance;
- Console.WriteLine("Ditt konto saldo är: " + saldo);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement