<PLEASE USE THE FOLLOWING TEMPLATE TO HELP YOU CREATE A GREAT POST!>
<Below this line, add a link to the EXACT exercise that you are stuck at.>
https://www.codecademy.com/courses/learn-java/projects/droid
<In what way does your code behave incorrectly? Include ALL error messages.>
Droid.java:38: error: illegal start of expression
public int checkBatteryLevel() {
^
Droid.java:38: error: ‘;’ expected
public int checkBatteryLevel() {
^
Droid.java:45: error: illegal start of expression
public void hover(int feet) {
^
Droid.java:45: error: illegal start of expression
public void hover(int feet) {
^
Droid.java:45: error: ‘;’ expected
public void hover(int feet) {
^
Droid.java:45: error: ‘;’ expected
public void hover(int feet) {
^
Droid.java:61: error: illegal start of expression
public static void main(String args){
^
Droid.java:61: error: illegal start of expression
public static void main(String args){
^
Droid.java:61: error: ‘;’ expected
public static void main(String args){
^
Droid.java:61: error: ‘.class’ expected
public static void main(String args){
^
Droid.java:61: error: ‘;’ expected
public static void main(String args){
^
much more
Replace this line with your code.
public class Droid {
int batteryLevel;
public Droid() {
int 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 void hover(int feet) {
if(feet > 2){
System.out.println("Error! I cannot hover above 2 feet.");
} else {
System.out.println("Hovering" + feet);
batteryLevel = batteryLevel - 20;
System.out.println("Battery level is: " + batteryLevel + "percent");
}
}
public static void main(String[] args){
Droid droid = new Droid();
droid.activate();
droid.chargeBattery(5);
droid.hover(1);
}