import java.util.Scanner; public class MajorityProgram { public static void main(String[] args) { char vote; int count = 0; Scanner keyboard = new Scanner(System.in); // Get the user input and apply to the total System.out.println("Enter vote 1 (y or n): "); vote = keyboard.next().charAt(0); if (vote == 'y') count++; else count--; System.out.println("Enter vote 2 (y or n): "); vote = keyboard.next().charAt(0); if (vote == 'y') count++; else count--; System.out.println("Enter vote 3 (y or n): "); vote = keyboard.next().charAt(0); if (vote == 'y') count++; else count--; System.out.println("Enter vote 4 (y or n): "); vote = keyboard.next().charAt(0); if (vote == 'y') count++; else count--; System.out.println("Enter vote 5 (y or n): "); vote = keyboard.next().charAt(0); if (vote == 'y') count++; else count--; if (count > 0) System.out.println("The majority voted YES"); else System.out.println("The majority voted NO"); } }