Advertisement
timleg002

Happifier

Dec 7th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.14 KB | None | 0 0
  1. package com.company;
  2. import java.util.Scanner;
  3.  
  4. public class beepboop {
  5.     static boolean whisper(String toWhisper){
  6.         System.out.println(toWhisper);
  7.         int happiness = 0;
  8.         happiness = happiness + 1;
  9.         if(toWhisper.equals("beep boop")) return true;
  10.         else return false;
  11.     }
  12.  
  13.     public static void main(String[] args) throws InterruptedException {
  14.         Scanner sc = new Scanner(System.in);
  15.         if(!args.equals(new String[]{"s"}))System.out.println("Do you want to cheer up? How happy are you? Enter a value from 0-100.");
  16.         int happiness = sc.nextInt();
  17.         if(happiness >= 100){
  18.             System.out.println("You are really happy!");
  19.             return;
  20.         }
  21.         if(happiness < 0) System.out.println("You are very sad!" + "\n" + "Let's see if this can cheer you up.");
  22.         Thread.sleep(1000);
  23.         for(; happiness < 100;){
  24.             boolean successfulWhisper = whisper("beep boop");
  25.             if(successfulWhisper) {
  26.                 happiness = happiness + 1;
  27.             }
  28.         }
  29.         System.out.println("Say this and you'll be happy to 100!");
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement