Question: In Java please 1. Write a method named countOccurrences. The method receives a character and a String and returns an int. The method returns the

 In Java please 1. Write a method named countOccurrences. The method

In Java please

1. Write a method named countOccurrences. The method receives a character and a String and returns an int. The method returns the number of times that the received character is found in the received String, case insensitive method signature: public static int countOccurrences(char ch, String word) Example values: countOccurrences('a', "bcaabc") should return 2 countOccurrences('f, "bca") should return 0 countOccurrences('a', "bbbAccc") should return 1 2. Write a method named toCentimeters, the method receives a double, which is number of inches and returns the equivalent centimeters for the receive inches. (Look up a conversion formula, be sure that you use double type values in your formula). method signature: public static double to Centimeters(double inches) Example values: toCentimeters(1.0) should return 2.54 to Centimeters(36.0) should return 91.44 toCentimeters(100.0) should return 254.0 to Centimeters(-100.0) should return -254.0 3. Write a method named getLetterGrade. The method receives a grade average (double) returns the corresponding letter grade - use 90.0,80.0,70.0.60.0 as cutoffs for A, B, C, D, F. Any grade average received that is below 0.0 or over 105.0 return 'X' method signature: public static char getLetterGrade(double gradeAvg) Example values: getLetterGrade(90.0) should return 'A' getLetterGrade(85.2) should return 'B' getLetterGrade(69.9) should return 'D' getLetterGrade(78.33) should return 'C' getLetterGrade(110.0) should return 'X' getLetterGrade(104.3) should return 'A

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!