import java.util.Scanner;
import java.util.ArrayList;
public class HorticultureQuiz
{
public static void main (String[] args)
{
int c =0;
int incorrect = 0;
boolean one = true;
boolean two = false;
boolean three = true;
boolean four = true;
boolean five = false;
boolean End = true;
String first, major, last, confidence;
Scanner keyboard = new Scanner(System.in);
for (int i = 0;i<3;i++){
System.out.println("Enter first name...");
first = keyboard.nextLine();
System.out.println("Enter last name ...");
last = keyboard.nextLine();
System.out.println("Enter college major...");
major = keyboard.nextLine();
System.out.println("When it comes to test taking are your high(overly confident),medium (semi-confident), and low ( not confident)?");
confidence = keyboard.nextLine();
System.out.println("\n 1. True or False Traditionly Horticulture deals with garden crops such as fruits, nuts, vegetables, culinary herbs,"+
" and spices , beverage crops, medicinals and ornamental plants.");
one = keyboard.nextBoolean();
if (one == true){
System.out.println("Off to a great start! Correct Answer!");
c++;
}else{
System.out.println("Incorrect!The correct answer is true!");
incorrect++;
}
System.out.println("2. True or False Fruit is defined as a woody plant that is smaller"
+" than a tree and generally has several separate stems rather than a single trunk.");
two = keyboard.nextBoolean();
if (two == false){
System.out.println("Correct!! Good Job!");
c++;
}else{
System.out.println("Incorrect! The answer is false, a shurb is defined as a woody plant that is smaller than"
+ " a tree and generally has several separate stems rather than a single trunk.");
incorrect++;
}
System.out.println("3. True or False pH is a value that indicates the acidity or alkalinity of a solution on a scale of 0-14, based on the proportion of H+ ions.");
three = keyboard.nextBoolean();
if (three == true ){
System.out.println("Correct!! Great Job!!");
c++;
}else{
System.out.println("Incorrect Try harder! The right answer is True.");
incorrect++;
}
System.out.println("4. True or False a spider plant is defined as Perennial: Indoor plant during winter used in hanging basket, Narrow,"
+ " arching leaves will have tiny plantlets");
four = keyboard.nextBoolean();
if (four == true){
System.out.println("Correct!! Execellent!!");
c++;
}else{
System.out.println("Wrong! The correct answer is true.");
incorrect++;
}
System.out.println("5. True or False Common Boxwood is defined as perennial: Small deciduous tree: Flower oval shape: Four showy white or pink bracts(flower petals)");
five = keyboard.nextBoolean();
if (five == false){
System.out.println("Correct answer!");
c++;
}else{
System.out.println("Wrong! A Common Boxwood is defined as large green shrub opposite, leathey leaves, dark green above yellow green below.");
incorrect++;
}
}
}
}
This is my code so far. I want to get the results after each loop but I do not know how to do that. And also show the number of correct answer from each loop. I am lost when it comes to this.