Loop Homework #1 Copy and paste the folowing into Eclipse. import java.util.Scanner; /* YOUR NAME Loop Hwk #1 Comp 110 * Assigned: Mon 2/21 * Due: Fri 2/5 at start of lab * You may work together on these problems, but each student * must turn in their solution on Sakai. * This homework is just practice writing loops in Java. * You do not need an Implementation Plan or a Test Plan. * Just complete the Java code for each of the methods. */ public class LoopFeb18Monday { public static void main( String[] args) { // Change the name of this method (e.g. question1) to // run your code for a different question on this assignment. question0(); } /* * Ask the user to "Enter a positive integer" * Print out the sum of the first n odd integers * where n is the number entered by the user. * For example, if the user enters 5, print out * 25 = 1 + 3 + 5 + 7 + 9 */ public static void question0() { Scanner keyboard = new Scanner(System.in); System.out.println("Enter a positive integer"); int n = keyboard.nextInt(); // Put your code here } /* * Question 1 * Ask the user to enter a string. Print out the characters * of the string one per line followed by the number of characters. * For example, input "cat" produces output * c * a * t * 3 */ public static void question1() { Scanner keyboard = new Scanner(System.in); System.out.println("Enter a string "); String input = keyboard.nextLine(); // Your code goes here } /* Question 2 * Ask the user to enter a string. Print the characters * in reverse order on a single line followed by the number of * characters. For example, input "cat" produces output * tac * 3 */ public static void question2() { // Your code goes here } /* * Problem - count the number of 'e's in a string * * Ask the user to enter a string. Print the number of * times the letter 'e' appears in the string. For * example, input "seerer" produces the output * the letter e occurs 3 times in seerer */ /* * Question 3 * Count the number of 'e's using a 'while' loop. */ public static void question3() { // Your code goes here } /* * Question 4 * Count the number of 'e's using a 'for' loop. */ public static void question4() { // Your code goes here } /* * Problem - count the number of vowels in a string. * Ask the user to enter a string. Print the number of vowels * in the string. Count only aeiou not y. For example, * the input "anapolis" produces output * * there are 4 vowels in anapolis */ /* * In questions 5 and 6, you may use any type of loop you wish: * while, do-while, or for */ /* * Question 5 - count vowels. * Use only nested if statements (no compound conditions) */ public static void question5() { // Your code goes here } /* * Question 6 - count vowels. * Use only one if statement with a compound condition */ public static void question6() { // Your code goes here } /* * Question7 - count vowels. * Use only chained if statements (no compound conditions) */ public static void question7() { // Your code goes here } }