Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- namespace ATM
- {
- class Program {
- public static void LogginIn(Client c,int inputPin)
- {
- while (c.getPin()!= inputPin) {
- Console.WriteLine("Please input correct pincode!");
- inputPin = Convert.ToInt32(Console.ReadLine());
- }
- }
- public enum Servise
- {
- availableSum,
- payment,
- chek,
- changeOfPin
- }
- public static void AtmOption(Servise s, Client client)
- {
- double pay = Convert.ToInt32(Console.ReadLine());
- client.setPayment(pay);
- int newPin = Convert.ToInt32(Console.ReadLine());
- client.setPin(newPin);
- switch (s)
- {
- case Servise.availableSum:
- Console.WriteLine("you'r available sum is{0:C}", client.getAvailableSum());
- break;
- case Servise.payment:
- Console.WriteLine("you have selected import into account,input money{0}",pay);
- break;
- case Servise.chek:
- Console.WriteLine("you have selected an account verification", client.getAvailableSum());
- break;
- case Servise.changeOfPin:
- Console.WriteLine("u check change of pin set new pin code{}", newPin);
- break;
- default:
- break;
- }
- }
- static void Main(string[] args)
- {
- Client client = new Client();
- client.setPin(5532);
- client.setAvailableSum(530);
- Console.WriteLine("input pin code:");
- int pass = Convert.ToInt32(Console.ReadLine());
- LogginIn(client, pass);
- Console.WriteLine("Hello our ATM have option 0-available sum" +
- "1-payment 2-check 3 -change of pin");
- int op = Convert.ToInt32(Console.ReadLine());
- AtmOption((Servise)op, client);
- Console.ReadKey();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement