Skip to content

Instantly share code, notes, and snippets.

@nikhilrajsingh
Created July 27, 2020 16:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nikhilrajsingh/57deb708f3811747104c0d00036e58fb to your computer and use it in GitHub Desktop.
Save nikhilrajsingh/57deb708f3811747104c0d00036e58fb to your computer and use it in GitHub Desktop.
Lab3Task
/* 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