Question: for java Problem 2: 40 % A String contains the information of students in the following format. String dataBase = FirstNamel LastNamel birth Yearl idl

Problem 2: 40 % A String contains the information of students in the following format. String dataBase = "FirstNamel LastNamel birth Yearl idl gpal,FirstName2 LastName2 birth Year2 id2 gpa2...." birth Year and id are stored as integer values and gpa as a double value. A. Write a method named averageAge that takes a string in the above format and returns the average age of the students. The method's header is as follows: public static double averageAge(Strings) { } B. Write a method named averageGPA that takes a string in the above format and returns the average age of all the students. The method's header is as follows: public static double averageGPA(String s) { } C. Extra credit: 20%) Write a method'named studentInfo that takes two arguments: A string in the above format and an integer value. The information of the student whose ID is provided as the second argument is displayed. The header of the method is as follows: public static void employeeInfo(String s, int id) { } The method displays "Record unfound" if the second argument does not match any student's ID
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
