import java.lang.*; //all import statements must be first import java.util.Scanner; //program uses class Scanner /** prompts user to enter 10 numbers, then displays largest and * average of the numbers. * @version 1 * @see java.lang.String * @see java.util.Scanner */ public class JavaMain { public static void main (String args[]) { Scanner input = new Scanner (System.in); int number1 = 0; int number2 = 0; int number3 = 0; int number4 = 0; int number5 = 0; int number6 = 0; int total = 0; int number7 = 0; int number8 = 0; int number9 = 0; int number10 = 0; int number11 = 0; int number12 = 0; int total1 = 0; int total2 = 0; int total3 = 0; int total4 = 0; int total5 = 0; int total6 = 0; { System.out.print ("\nEnter your hybrid activity mark out of 10:"); number1 = input.nextInt(); total1 = number1 / 10; number7 = total1 * 0.05; System.out.print ("\nEnter your lab mark out of 6: "); number2 = input.nextInt(); total2 = number2 / 10; number8 = total2 * 0.10; System.out.print ("\nEnter your assignments mark out of 100: "); number3 = input.nextInt(); total3 = number3 / 100; number9 = total3 * 0.25; System.out.print ("\nEnter your test #1 mark out of 30: "); number4 = input.nextInt(); total4 = number4 / 30; number10 = total4 * 0.15; System.out.print ("\nEnter your test #2 mark out of 30: "); number5 = input.nextInt(); total5 = number5 / 30; number11 = total5 * 0.15; System.out.print ("\nEnter your final exam mark out of 60: "); number6 = input.nextInt(); total6 = number6 / 60; number12 = total6 * 0.30; total = number7 + number8 + number9 + number10 + number11 + number12; } // calculations System.out.println ("Final Mark: " + total); } // end of main }// end of class
I am new to programming and I cant seem to run it and says "
C:\MyJava>javac JavaMain.java
JavaMain.java:39: error: possible loss of precision
number7 = total1 * 0.05;
^
required: int
found: double
JavaMain.java:44: error: possible loss of precision
number8 = total2 * 0.10;
^
required: int
found: double
JavaMain.java:49: error: possible loss of precision
number9 = total3 * 0.25;
^
required: int
found: double
JavaMain.java:54: error: possible loss of precision
number10 = total4 * 0.15;
^
required: int
found: double
JavaMain.java:59: error: possible loss of precision
number11 = total5 * 0.15;
^
required: int
found: double
JavaMain.java:64: error: possible loss of precision
number12 = total6 * 0.30;
^
required: int
found: double
6 errors
C:\MyJava>
Please help me Im soo noob.