「int total = (mark/overall) * 100;」ではない理由 働く?25/50 * 100 を計算した後、50% になるはずの 25 と 50 を入力すると、代わりに 0% が表示され、非常に奇妙です。助言がありますか??
public class MarksCalculator {
private static Scanner kb = new Scanner(System.in);
public static void main (String[]args) {
int mark = 0, overall = 0;
//System.out.print("Hello Deepo! To calculate the marks enter value (percantage) of the task: ");
//int weight = kb.nextInt();
System.out.print("Enter your marks for this Task/Assesment/Test: ");
mark = kb.nextInt();
System.out.print("What was this mark out of: ");
overall = kb.nextInt();
int total = (mark/overall) * 100;
System.out.println("You have scored " + total + "% with this assesment.");
}
}