Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
for java
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Sham Navathe,Ramez Elmasri

5th Edition

B01FGJTE0Q, 978-0805317558

More Books

Students also viewed these Databases questions

Question

use R as coding language

Answered: 1 week ago