Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.company;
- import java.util.Scanner;
- public class beepboop {
- static boolean whisper(String toWhisper){
- System.out.println(toWhisper);
- int happiness = 0;
- happiness = happiness + 1;
- if(toWhisper.equals("beep boop")) return true;
- else return false;
- }
- public static void main(String[] args) throws InterruptedException {
- Scanner sc = new Scanner(System.in);
- 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.");
- int happiness = sc.nextInt();
- if(happiness >= 100){
- System.out.println("You are really happy!");
- return;
- }
- if(happiness < 0) System.out.println("You are very sad!" + "\n" + "Let's see if this can cheer you up.");
- Thread.sleep(1000);
- for(; happiness < 100;){
- boolean successfulWhisper = whisper("beep boop");
- if(successfulWhisper) {
- happiness = happiness + 1;
- }
- }
- System.out.println("Say this and you'll be happy to 100!");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement