What is wrong with this? I get an error saying there is no main type.
Calc.java
Code:
package Calcer;
public class Calc {
public static void Main(String[] args) {
//read score
System.out.println("How many points did you get?");
double pointsRecieved = InputClass.readDouble();
System.out.println("What was the number of points possible?");
int pointsPossible = InputClass.readInt();
//calculate percentage
double dec = 100*(pointsRecieved/pointsPossible);
int percent = (int)dec;
System.out.println("You got " + percent + " percent!");
//calculate letter grade
if (percent >= 92) {
System.out.println("You got an A!");
} else if (percent >=82) {
System.out.println("You got a B!");
} else if (percent >= 72) {
System.out.println("You got a C.");
} else if (percent >= 62) {
System.out.println("You got a D.");
} else {
System.out.println("You got an F.");
}
}
}
and InputClass.java
Code:
package Calcer;
import java.io.*;
public class InputClass {
public static String readString() {
BufferedReader br
=new BufferedReader(new InputStreamReader(System.in), 1);
String string = " ";
try {
string = br.readLine();
}
catch (IOException ex) {
System.out.println(ex);
}
return string;
}
public static int readInt() {
int integer = Integer.parseInt(readString());
return integer;
}
public static double readDouble() {
double dub = Double.parseDouble(readString());
return dub;
}
}