@stetim94/

OpenOvercookedAsiantrumpetfish

Java

No description

fork
loading
Files
  • Main.java
  • Dog.java
  • library.java

This Plugin Crashed!

Error: Error: must not create an existing file {"type":"CREATE_FILE","wid":"0.24856909396130367","path":"Main.java","file":{"path":"Main.java","content":{"asEncoding":{"base64":"cHVibGljIGNsYXNzIERyb2lkIHsKCWludCBiYXR0ZXJ5TGV2ZWw7IAogIERyb2lkKCkgewogICAgYmF0dGVyeUxldmVsID0gMTAwOwogIH0KCXB1YmxpYyB2b2lkIGFjdGl2YXRlKCkgewoJCVN5c3RlbS5vdXQucHJpbnRsbigiQWN0aXZhdGVkLiBIb3cgY2FuIEkgaGVscCB5b3U/Iik7CgkJYmF0dGVyeUxldmVsID0gYmF0dGVyeUxldmVsIC0gNTsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiQmF0dGVyeSBsZXZlbCBpczogIiArIGJhdHRlcnlMZXZlbCArICIgcGVyY2VudC4iKTsKICB9ICAKICBwdWJsaWMgdm9pZCBjaGFyZ2VCYXR0ZXJ5KGludCBob3VycykgewoJCVN5c3RlbS5vdXQucHJpbnRsbigiRHJvaWQgY2hhcmdpbmcuLi4iKTsKICAgIGJhdHRlcnlMZXZlbCA9IGJhdHRlcnlMZXZlbCArIGhvdXJzOwoJCQlpZiAoYmF0dGVyeUxldmVsID4gMTAwKSB7CiAgICAgICAgCWJhdHRlcnlMZXZlbCA9IDEwMDsKCQkJCQlTeXN0ZW0ub3V0LnByaW50bG4oIkJhdHRlcnkgbGV2ZWwgaXM6ICIgKyBiYXR0ZXJ5TGV2ZWwgKyAiIHBlcmNlbnQuIik7CiAgICAgIAkJfQogICAgCWVsc2UgewoJCQkJCVN5c3RlbS5vdXQucHJpbnRsbigiQmF0dGVyeSBsZXZlbCBpczogIiArIGJhdHRlcnlMZXZlbCArICIgcGVyY2VudC4iKTsKICAgIAkJCX0gICAgCgkJCQl9CglwdWJsaWMgaW50IGNoZWNrQmF0dGVyeUxldmVsKCkgewoJCQkJCVN5c3RlbS5vdXQucHJpbnRsbigiQmF0dGVyeSBsZXZlbCBpczogIiArIAkJCQliYXR0ZXJ5TGV2ZWwgKyAiIHBlcmNlbnQuIik7CiAgICAgIAkJcmV0dXJuIGJhdHRlcnlMZXZlbDsKCQl9CnB1YmxpYyBpbnQgaG92ZXIgKGludCBmZWV0KXsKICAJaWYgKGZlZXQgPiAyKXsKICAgIFN5c3RlbS5vdXQucHJpbnRsbigiRXJyb3IhIEkgY2Fubm90IGhvdmVyIGFib3ZlIDIgZmVldC4iKTsKICB9IAogIAllbHNlewogICAgICBTeXN0ZW0ub3V0LnByaW50bG4oIkhvdmVyaW5nLi4uIik7CiAgICAgIGJhdHRlcnlMZXZlbCA9IGJhdHRlcnlMZXZlbCAtIDIwOwogIFN5c3RlbS5vdXQucHJpbnRsbigiQmF0dGVyeSBsZXZlbCBpczogIiArIGJhdHRlcnlMZXZlbCArICIgcGVyY2VudC4iKTsgICAKfQp9CiAgcHVibGljIHN0YXRpYyB2b2lkIG1haW4oU3RyaW5nW10gYXJncyl7CiAgRHJvaWQgbXlEcm9pZCA9IG5ldyBEcm9pZCgpOwogIG15RHJvaWQuYWN0aXZhdGUoKTsKICBteURyb2lkLmNoYXJnZUJhdHRlcnkoNSk7CiAgbXlEcm9pZC5ob3Zlcig1KTsKCX0KfQ=="},"asBuffer":null},"loaded":true}}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class Droid {
	int batteryLevel; 
  Droid() {
    batteryLevel = 100;
  }
	public void activate() {
		System.out.println("Activated. How can I help you?");
		batteryLevel = batteryLevel - 5;
    System.out.println("Battery level is: " + batteryLevel + " percent.");
  }  
  public void chargeBattery(int hours) {
		System.out.println("Droid charging...");
    batteryLevel = batteryLevel + hours;
			if (batteryLevel > 100) {
        	batteryLevel = 100;
					System.out.println("Battery level is: " + batteryLevel + " percent.");
      		}
    	else {
					System.out.println("Battery level is: " + batteryLevel + " percent.");
    			}    
				}
	public int checkBatteryLevel() {
					System.out.println("Battery level is: " + 				batteryLevel + " percent.");
      		return batteryLevel;
		}
public int hover (int feet){
  	if (feet > 2){
    System.out.println("Error! I cannot hover above 2 feet.");
  } 
  	else{
      System.out.println("Hovering...");
      batteryLevel = batteryLevel - 20;
  System.out.println("Battery level is: " + batteryLevel + " percent.");   
}
}
  public static void main(String[] args){
  Droid myDroid = new Droid();
  myDroid.activate();
  myDroid.chargeBattery(5);
  myDroid.hover(5);
	}
}