Beginner: Guru's Why want this complie

From: JavaMan (hot_at_dog.com)
Date: 10/30/04

  • Next message: IchBin: "Re: Beginner: Guru's Why want this complie"
    Date: Sat, 30 Oct 2004 02:24:00 GMT
    
    

    public class Hw5
    { public static void main(String[] args)

    { int x=10, y=12, z=8;
    System.out.println("The largest of " + x + ", " + y + " and " + z + " is: "
    + getLargest(x,y,z));
    System.out.println("The average of " + x + ", " + y + " and " + z + " is: "
    + getAverage(x,y,z));
    char c1='a', c2='b', c3='u';
    System.out.println(c1 + " is a vowel: " + isVowel(c1));
    System.out.println(c2 + " is a vowel: " + isVowel(c2));
    System.out.println(c3 + " is a vowel: " + isVowel(c3));
    String s1="hello", s2="madam";
    System.out.println(s1 + " is a palindrome: " + isPalindrome(s1));
    System.out.println(s2 + " is a palindrome: " + isPalindrome(s2));
    System.out.println(s1 + ": has " + countVowels(s1) + "vowels");
    System.out.println(s2 + ": has " + countVowels(s2) + "vowels");
    }

    // write the getLargest method here that will receive 3 integers and return
    the largest of them
    // it starts like the following
    public static int getLargest(int a, int b, int c)
    {
    if (a >= b && a >= c)
    return a;
    else if (b >= a && b >= c)
    return b;
    return c;
    }
    }
    // write getAverage method here that will receive 3 integers and return the
    average of them
    // write isVowel method here that will receive a character and return "true"
    if it is vowel, return "false" otherwise
    // write isPalindrome method here that will receive a string and return
    "true" if it is a palindrome, return "false" otherwise
    // write countVowels method here that will receive a string and return the
    number of vowels in the string


  • Next message: IchBin: "Re: Beginner: Guru's Why want this complie"

    Relevant Pages

    • Student.HELP.Why does this code not compile?
      ... // write the getLargest method here that will receive 3 integers and return ... public static int getLargest ... if it is vowel, return "false" otherwise ... // write countVowels method here that will receive a string and return the ...
      (comp.lang.java.help)
    • Student.HELP.Why does this code not compile?
      ... // write the getLargest method here that will receive 3 integers and return ... public static int getLargest ... if it is vowel, return "false" otherwise ... // write countVowels method here that will receive a string and return the ...
      (comp.lang.java.programmer)
    • Re: String and Char Help
      ... int vowel = 0; ... pos = String1.charAt; ... vowels in the String. ...
      (comp.lang.java.programmer)
    • Re: Brian Kernighan, maybe Im not worthy, maybe Im scum
      ... conformant string. ... int repeats, reps; ... ref satisfierLength); ...
      (comp.programming)
    • RE: Controling Modal Dialogs (Solution)
      ... doesn't return until the 'modal' browser returns. ... string varOptions) ... public void DocumentComplete ... int rc = winDisp.Invoke(rgDispId, ref guid, 0, ...
      (microsoft.public.inetsdk.programming.webbrowser_ctl)