Description
The following workshop lets you practice basic java coding techniques, creating classes, methods, using arrays, Java I/O, inheritance, polymorphism, Exceptional Handling, JavaFx (GUI), Lambda expressions, Functional Interface. Task 1: The details for the task are as follows, • The popularity ranking of baby names from years 2009 to 2018 is downloaded from www.ssa.gov/oact/babynames and stored in files named babynamesranking2009.txt, babynamesranking2010.txt, . . . , babynamesranking2018.txt. • Each file contains one thousand lines/ records. • Each line contains a ranking, a boy’s name, number for the boy’s name, a girl’s name, and number for the girl’s name. For example, the first two lines in the file babynameranking2010.txt are as follows: 1. Jacob 21,875 Isabella 22,731 2. Ethan 17,866 Sophia 20,477 So, the boy’s name Jacob and girl’s name Isabella are ranked #1 and the boy’s name Ethan and girl’s name Sophia are ranked #2. 21,875 boys are named Jacob and 22,731 girls are named Isabella. Note: There are some common names for both boys ang girls as well. You have to write a program that asks the user to enter the year, gender, and followed by a name, and displays the ranking of the name for the year. Here is a sample run: JAC – 444 Semester 2021 Task 2: (Lambda Practice) This task asks you to create your own lambda expressions using Functional Interface. • Define a functional interface named ArrayProcessor which has one function operations to returns a double and takes a double type array as its argument • Write a class that defines four public static final variables of type ArrayProcessor that process an array in the following ways: 1. find the maximum value in the array 2. find the minimum value in an array 3. find the sum of the values in the array 4. find the average of the values in the array. JAC – 444 Semester 2021 • In each case, the value of the variable should be given by a lambda expression. The class should also define a function public static ArrayProcessor counter(double value ) { … • This function should return an ArrayProcessor that counts the number of times that value occurs in an array. • The return value should be given as a lambda expression. • The class should have a main() routine that tests your work. • Ask the user to give array elements. JAC – 444 Semester 2021 Workshop Header /********************************************** Workshop # Course: – Semester Last Name: First Name: ID: Section: