CodShot
C# Public

ATM.cs

C#
using System;

namespace HF07
{
    internal class ATM
    {
        private string location;
        private Center center;

        public ATM(string location, Center center)
        {
            this.location = location;
            this.center = center;
        }

        public void Process(Customer c)
        {
            Card card = c.GiveCard();

            if (!card.PinCheck(c.GivePin()))
            {
                throw new Exception();
            }
            
            int a = c.AskMoney();

            if (!center.Transaction(card.CardNo, -a))
            {
                throw new Exception();
            }
        }
    }
}

Snippet actions

CodShot user
CodShot user
Updated: 2026-04-08 15:47
Public snippets
2
Forks
CodShot AI Help
Ask about CodShot features, plans, workspace, AI limits, referrals, and public help topics.
Hi! I can help you understand how CodShot works. What would you like to know?
For account-specific or sensitive issues, please open a support ticket. Open support