import java.util.Scanner;
public class Main
{
public static void main(String[] args) {
Scanner in=new Scanner(System.in);
String c;
int warranty=0;
while( true ){
System.out.println("Select between the following product warranty: ");
System.out.println("1-Applies a six-month product warranty.\nAny other key applies a two-year warranty.");
c=in.next();
if (c=="1"){
warranty=6;
System.out.println("Product details have been successfully saved");
break;
}
else{
warranty=24; //2years
System.out.println("Product details have been successfully saved");
break;
}
}
}
}
Comments
Leave a comment