College

We appreciate your visit to In this assignment you will use functional programming in Kotlin Objective Respond to user questions about the commonality of baby names in the United States. This page offers clear insights and highlights the essential aspects of the topic. Our goal is to provide a helpful and engaging learning experience. Explore the content and find the answers you need!

In this assignment, you will use functional programming in Kotlin.

**Objective**: Respond to user questions about the commonality of baby names in the United States over the period 2000-2009. The data is divided into two categories: boys and girls, according to their assigned gender at birth.

**Data Format**:
```
1,Jacob,34471,Emily,25953
2,Michael,32035,Hannah,23080
3,Matthew,28572,Madison,19967
4,Joshua,27538,Ashley,17997
5,Christopher,24931,Sarah,17697
6,Nicholas,24652,Alexis,17629
7,Andrew,23639,Samantha,17266
8,Joseph,22825,Jessica,15709
9,Daniel,22312,Elizabeth,15094
10,Tyler,21503,Taylor,15078
```

**Columns**:
- Row number: The data is sorted numerically, so the most common names for each assigned gender are in row 1.
- Boy name
- Boy frequency
- Girl name
- Girl frequency

**Task**:
1. Read the data files into two data structures: one containing boys' names and one containing girls' names.
2. From the command line, read a set of names (case insensitive) and show information about each name in the set, for each assigned gender.

**Example Command**:
```
UNIX> java -jar hw4.jar Aaron Devon Marlen
```

**Sample Output**:
```
Aaron
Boy Aaron 2 19088 0.5524
alphabetic position 1

Devon
Boy Devon 2 5695 0.1648
alphabetic position 284
Girl Devon 2 665 0.0234
alphabetic position 317

Marlen
Girl Marlen 1 212 0.0074
alphabetic position 760
```

**Requirements**:
- Your output must contain at least the information in the sample above.
- Your program must present data for all of 2000-2009.
- You may not use loops except for the one provided in the assignment.
- With one exception, no variables can be defined using "var". Specifically, if you create a "NameHolder" class, the data items holding the number of uses and the number of years in use can both be "var".
- You may use `MutableList` for storing data, but use it carefully.
- Make liberal use of functional constructs in Kotlin: `forEach`, `map`, `filter`, etc., to avoid using loops or recursion.
- While defining and using classes is not required, it is encouraged. Avoid leaving all data in the list of String representations returned by `readURL`. Doing so may result in a poor grade.
- Do not write your own list class. Use the Kotlin `List`. Utilize functions defined on lists like `map`, `filter`, and `forEach`.

Answer :

By employing functional programming techniques in Kotlin, the program can effectively handle the task of analyzing and presenting information about baby names in the given time period.

The task in this assignment is to read data files containing baby names and their frequencies for boys and girls. The program should then take user input from the command line, search for each name in the data, and display information about each name in terms of assigned gender. The program should make use of functional programming constructs in Kotlin, such as forEach, map, and filter, to manipulate the data without using loops.

The program reads the data files and stores the names and frequencies in separate data structures for boys and girls. It then processes user input names and searches for them in the data, displaying the relevant information for each name and assigned gender. Functional programming constructs like map and filter can be used to efficiently perform these operations without using loops.

By employing functional programming techniques in Kotlin, the program can effectively handle the task of analyzing and presenting information about baby names in the given time period. Utilizing functions like forEach, map, and filter helps in avoiding explicit loops and simplifying the data manipulation process.

To know more about Programming , visit

brainly.com/question/29891194

#SPJ11

Thanks for taking the time to read In this assignment you will use functional programming in Kotlin Objective Respond to user questions about the commonality of baby names in the United States. We hope the insights shared have been valuable and enhanced your understanding of the topic. Don�t hesitate to browse our website for more informative and engaging content!

Rewritten by : Barada