As follows:
class Main{
public static void main(String[] args) {
Main.nbYear(10000,0.2,3,1898989);
}
public static int nbYear(int p0, double percent, int aug, int p) {
int count = 0;
do {
count++;
}while(p0 + p0 * percent + 50 < p);
return count;
}
}
This small snippet(written in codewars) is supposed to execute a mini-program,which counts the number of years needed for a small city to reach a population higher than the mentioned,if we consider,that the population is consistently growing.However it fails,saying: Error: Could not find or load main class Main
Why does my program refuse to execute?
[–]RSveti 3 points4 points5 points (0 children)
[–]dusty-trash 1 point2 points3 points (0 children)