├── Code └── README.md /Code: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | import java.util.Arrays; 3 | public class Main 4 | { 5 | public static void main(String[] args) { 6 | Scanner sc=new Scanner(System.in); 7 | System.out.println("<-----------------------WELCOME---------------------->"); 8 | System.out.print("Enter the total number of floors: "); 9 | int n=sc.nextInt(); 10 | System.out.print("Enter your current floor: "); 11 | int c=sc.nextInt(); 12 | System.out.print("Where you want to go: "); 13 | String s=sc.next(); 14 | char a[]=new char[s.length()]; 15 | for(int i=0;i0) c--; 19 | else if(a[i]=='f'||a[i]=='F') c=c; 20 | } 21 | if(c==0) System.out.println("You are in the Ground Floor"); 22 | else System.out.println("Your in the floor: " + c); 23 | System.out.println(); 24 | System.out.println(); 25 | System.out.println(); 26 | System.out.println(); 27 | System.out.println("Do you want to continue?"); 28 | System.out.println("1.Yes"); 29 | System.out.println("2.No"); 30 | System.out.print("Enter 1 or 2: "); 31 | int p=sc.nextInt(); 32 | System.out.println(); 33 | System.out.println(); 34 | if(p==1) main(null); 35 | else System.out.println("<--------------------------Thank you------------------->"); 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Lift-Scenario-in-Java --------------------------------------------------------------------------------