Created
July 27, 2020 16:07
-
-
Save nikhilrajsingh/57deb708f3811747104c0d00036e58fb to your computer and use it in GitHub Desktop.
Lab3Task
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Created by IntelliJ IDEA. | |
* Author: Nikhil Raj Singh | |
* Date: 27/07/20 | |
* Time: 8:42 pm | |
* File: Lab3Task.java | |
*/ | |
import java.util.Scanner; | |
public class Lab3Task { | |
public static final String DISCOUNT_CODE = "CoVid19"; | |
public static void main(String[] args) { | |
Scanner scannerObject = new Scanner(System.in); | |
String clintInputDiscountCode = scannerObject.next(); | |
if (clintInputDiscountCode.equalsIgnoreCase(DISCOUNT_CODE)) { | |
System.out.println("Congrats,you get Rs.100 off on your bill!. "); | |
} | |
else if(clintInputDiscountCode.isBlank() || clintInputDiscountCode.isEmpty()){ | |
System.out.println("The coupon code cannot be blank or empty. "); | |
} | |
else{ | |
System.out.println("Wrong coupon code. please try again"); | |
} | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment