Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package practice;
- import java.util.Scanner;
- public class project {
- public static void main(String[] args) {
- System.out.println("Hello, Welcome to the food app");
- System.out.println("Please create a password: ");
- Scanner scan = new Scanner(System.in);
- String pass1 = scan.next();
- System.out.println("Your password is now: "+ pass1);
- System.out.println("Please enter your password: ");
- String pass = scan.next();
- while(!pass.equals(pass1)) {
- System.out.println("This is not the right password, please try again: ");
- pass = scan.next();
- }
- System.out.println("Access granted");
- System.out.println("Are you hungry: Yes or No : ");
- String ans1 = scan.next();
- if(ans1.equals("yes")) {
- System.out.println("Choose what you want to eat between: pizza, burger or fish");
- String ans2 = scan.next();
- while(!ans2.equals("pizza") && !ans2.equals("burger") && !ans2.equals("fish")) {
- System.out.println("Sorry we do not have it, what would you like between: pizza, burger or fish");
- ans2 = scan.next();
- }
- if (ans2.equals("pizza") || ans2.equals("burger") || ans2.equals("fish")) {
- System.out.println("Do you want something to drink? ");
- String ans3 = scan.next();
- }
- }
- else {
- System.out.println("Alright, have a good day");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement