Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- cabinet
- import java.util.Scanner;
- public class cabinet {
- static int wineinbottle = 8;
- static int wineinglass = 0;
- static int choice = 0;
- public static void main(String args[]){
- bottle bottleObject = new bottle();
- Scanner input = new Scanner(System.in);
- System.out.println("Enter 1 to pour the wine from the bottle into the glass");
- System.out.println("Enter 2 to drink wine");
- System.out.println("Enter 3 to drink wine");
- choice = input.nextInt();
- if(choice == 1){
- bottle.pourwine(wineinbottle, wineinglass, choice);
- }
- System.out.println(wineinbottle);
- System.out.println(wineinglass);
- }
- }
- bottle
- public class bottle {
- public static int wineinbottle = 8;
- public static int wineinglass = 0;
- public static void pourwine(int wineinbottle, int wineinglass, int choice){
- wineinbottle --;
- wineinglass ++;
- }
- public static void drink(int wineinglass){
- switch(wineinglass){
- case 1:
- }
- }
- }
Add Comment
Please, Sign In to add comment