CSC211 LAB 9

  1. Pleas complete the following survey
    http://www.itd.depaul.edu/quickdata2/viewwebform.asp?id=4560
  2. Edit, Compile and Run the following piece of code.
  3. class ArrayEx2 {
    	public static void main(String [] args) {
    		// using initializer list to create
    		// and initialize the array.
    		int [] data = {5,7,1,9,20};
    		/*
    		 * data[0] contains 5
    		 * data[1] contains 7
    		 * data[2] contains 1
    		 * data[3] contains 9
    		 * data[4] contains 20
    		 *
    		 */
    		 printArray(data);		 
    		
    	 }
    	 public static void printArray(int [] data){
    		 for(int i = 0; i < data.length; i++)
    		 System.out.print(data[i] + "  ");
    
    		 System.out.println();
    	 }
     }
     
  4. Add the following methods to ArrayTool.java. Get ArrayTool.java from the course homepage under class 8.
  5. Write a method called isVowel that will input a character and return true or false whether or not that character is a vowel.

  6. Write a program that prompts the user to input a sequence of characters and outputs the number of vowels. Use the method from question 1.
  7. Consider the following program segment.
  8. class Ch7Ex3 { public static void main(String [] args) { int num; double dec; } public static int one(int x, int y) { } public static double two(int x, double a) { int first; double z; } }