Lab 4 - Methods
Lab 4 - Methods
Exercise 1 :
Write a program that reads a student’s name together with his or her test scores.
The program should then compute the average test score for each student and
assign the appropriate grade. The grade scale is as follows:
90-100, A; 80-89, B; 70-79, C; 60-69, D; 0-59, F.
Sample Output: The output should be in the following form. Fill the last two columns
and the last line showing the class average. (Output test average and class average
with two decimal places.)
Class Average =
Exercise 2:
Write a java program that creates an array containing a list of 10 email addresses. The content is
entered by the user and only valid emails are accepted (should respect the following format
[email protected]).
The program should then find the domain name that has the maximum number of occurrences.
[email protected]
[email protected] Output : The domain name that has the
[email protected] maximum number of occurrences is
[email protected] gmail.com with 4 occurrences.
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]