Hello, I need this to be checked rough thoroughly and it keeps giving me 2 results instead of 1 each and what changes I need to do.
My questions are:
• Question 1: What is the acronym for School? Answer GCHSS
• Question 2: How many different buildings/blocks are there in this school? Answer 5
• Question 3: This school includes a football ground on its premises. Answer true ```
Incoming long coding as taking a screenshot won't fit !
``` import java.util.Scanner;
public class CMPTTask2{
public static void main (String args[]){
// Declaring Correct Count
int correctCount = 0;
// Entering the input according to the quiz
// Question 1
Scanner input = new Scanner (System.in);
System.out.println("Question 1: What is the acronym for School?");
String SCHL = input.nextLine();
if(SCHL.equals("GCHSS")) {
System.out.println("\nCorrect!");
correctCount++;
}
else {
System.out.println("\nWrong!");
}
// Question 2
System.out.println("Question 2: How many different buildings/blocks are there in this school?");
String num = input.nextLine();
if(num.equals("5")) {
System.out.println("\nCorrect!");
correctCount++;
}
else {
System.out.println("\nWrong!");
}
// Question 3
System.out.println("Question 3: This school includes a football ground on its premises");
String statement= input.nextLine();
if(statement.equals("true")) {
System.out.println("\nCorrect!");
correctCount++;
}
else {
System.out.println("\nWrong!");
}
// Results
if (correctCount==correctCount) {
System.out.println("\nYou are a winner" + correctCount + "/3");
}
if (correctCount>=3) {
System.out.println("\nYou did well" + correctCount + "/3");
}
else {
System.out.print(correctCount>=3);
}
if (correctCount != 3) {
System.out.println("\nYou can do better" + correctCount + "/3");
}
}
} ```