Can someone please explain why this division is not working. This is very simple division but for some reason it won't work.
double Percent = Correct / Questions;
//****************************************************************
// Quizzes.java
//
// Calculates quizz scores.
//
//
// ****************************************************************
import java.util.Scanner;
public class Quizzes
{
public static void main(String[] args)
{
final int SALESPEOPLE;
int sum;
int Questions;
int answers;
int Correct = 0;
int Incorrect = 0;
//double Percent;
Scanner scan = new Scanner(System.in);
System.out.println("How many questions are in the quizz?");
Questions = scan.nextInt();
System.out.println("The number of questions will be " +Questions);
int[] canswers = new int[Questions];
for (int i=0; i<canswers.length; i++)
{
System.out.println("Please give the correct answers " + (i+1) + ": ");
canswers[i] = scan.nextInt();
}
for (int i=0; i<canswers.length; i++)
{
System.out.println("What are the answers that the students put");
answers = scan.nextInt();
if (answers == canswers[i])
Correct++;
else
Incorrect++;
}
double Percent = Correct / Questions;
System.out.println("There are " +Correct + " correct answers and " +Incorrect
+" answers");
System.out.println(Correct);
System.out.println(Incorrect);
System.out.println(Questions);
System.out.println(Percent);
System.out.println("The percentage correct is" +Percent);
}
}