Slot machines are casino games that accept both cash and paper tickets with barcodes (called ticket-in and ticket-out machines). When…