A rectangular floor that measures 8 meters by 10 meters is to be covered with carpet squares that each measure 2 meters by 2 meters. If the carpet squares cost $12 a piece, what is the total cost for the number of carpet squares needed to cover the floor?