Answer:
In Java
Step-by-step explanation:
package application;
import java.util.Scanner;
import entities.Astronaut;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.print("How is the astronaut's energy in a scale of 0 to 100? ");
int energy = sc.nextInt();
Astronaut fakeArmstrong = new Astronaut();
while (energy > 0) {
fakeArmstrong.hop();
energy--;
}
System.out.println("The astronaut is tired eh? Let him rest you psychopato");
sc.close();
}
}
----------------------------------------------------------------------------------------------
package entities;
public class Astronaut {
private int bodyEnergy;
public Astronaut() {
}
public int getBodyEnergy() {
return bodyEnergy;
}
public void hop() {
System.out.println("up and down!");
}
}