Changed switch statement into if-else if- else block

Also created CheckoutClass file.