interfaces-card-atm-bank

command
v0.0.0-...-a2a1f02 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 1, 2020 License: MIT Imports: 3 Imported by: 0

README

interfaces-card-atm-bank example

Using interfaces to show how a bank card is used to interact with an atm and bank.

GitHub Webpage

OVERVIEW / GOAL

This is the bare bones minimum to really highlight interfaces. For example, you could add pins, account numbers, a database. etc...

The goal is to create some interfaces for the bank, card and atm machine respectively,

b1 := bank.NewBoaBank("elmStBranch")
c1 := bank.NewBoaCard(b1, "Jeff")
a1 := atm.NewATM("123Main")

Then add some accounts to the bank,

bank.NewBoaAccount(b1, "Jeff", 100)

Finally load the bank information in the atm machines,

atm.LoadBank(b1)
atm.LoadBank(b2)

Now we can use an atm machine with your card to do things,

atm.ShowBalance(a1, c1)
atm.Deposit(a1, c1, 740)
atm.Withdraw(a1, c1, 50)

This image shows the various functions and methods I made in my packages.

IMAGE - interfaces-card-atm-bank - IMAGE

RUN

Run,

go run insterfaces-card-atm-bank.go

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL