title: Write a Java program that generates five questions and reports the number of the correct answers after a student answers all five questions
body: <p>I'm new at java, and i am trying to write a code that displays the number of questions they got right, not that they got each one right. When i try to run it, i can't make it display the number of questions they got right. For example, i want it to say "You got 4 out of 5 questions correct!", depending on how many they got right. This is what i have so far:</p>
  
  <pre><code>import java.util.Scanner;
  
  public class Addition {
  
     public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int count = 0;
        while (count &lt; 5){
           int number1 = (int)(Math.random() * 100);
           int number2 = (int)(Math.random() * 100);
           System.out.println("What is " + number1 + " + " + number2 + "?");
           count++;
           int answer = number1 + number2;
           int guess = sc.nextInt();
           boolean correct = guess == answer;
           if (guess == answer){
           }      
           System.out.println("You got " + correct + " correct");
        }     
     }
  }
  </code></pre>