Question: Hello guys, i need to create a java OOP program that will work with any csv file.. This program needs do to some operations as

Hello guys, i need to create a java OOP program that will work with any csv file..

This program needs do to some operations as SUM, COUNT, AVG, MIN and MAX

Here are some input and output examples

Generic ex:

Input:

F // Csv file name

Column1Name,Column2Name

Operation type (sum,avg,min,max,count)

Column3Name // Column where are the values that we want to do the operation for example SUM

Here are some examples of input and output for this CSV file :

Ex.1 Input:

Customer_Data.csv

Geography,Gender

SUM

Tenure

Output:

{[Germany, Male]=6646, [Germany, Female]=5924, [France, Male]=13901, [France, Female]=11192, [Spain, Male]=7020, [Spain, Female]=5445.}

Basiclly we need to sum all the values of tenure where the gender is male and from germany, all the values of tenure where the gender is female and from germany, all the values of tenure where the gender is Male and from France, all the values where the gender is Female and from France, all the values of tenure where the gender is Male and from Spain, all the values where the gender is Female and from Spain.

Note that the order of columns in the output does not matter.

Ex. 2 Input:

Customer_Data.csv

Geography,Gender

AVG

Age

Output:

{[Germany, Male]=39.42477203647417, [Germany, Female]=40.154233025984915 [France, Male]=38.2964039229931, [France, Female]=38.77399380804953, [Spain, Male]=38.64913544668588, [Spain, Female]=39.19926538108356}

Ex. 3 Input:

Customer_Data.csv

Geography,Exited

SUM

CreditScore

Output:

{[Germany, 1]=527219, [Germany, 0]=1107278, [France, 1]=519951, [France, 0]=2737486, [Spain, 0]=1345943, [Spain, 1]=267411}

The csv file has 10 000 lines soo i will leave here the dowload file : https://mega.nz/file/b0hDXQxY#Aggwpz7GVMY8-0Dl6N9L0tpEKekjmw9rmoCV_CdGTd8

I will leave here the first 26 lines of the file, thanks !

RowNumber,CustomerId,Surname,CreditScore,Geography,Gender,Age,Tenure,Balance,NumOfProducts,HasCrCard,IsActiveMember,EstimatedSalary,Exited
1,15634602,Hargrave,619,France,Female,42,2,0,1,1,1,101348.88,1
2,15647311,Hill,608,Spain,Female,41,1,83807.86,1,0,1,112542.58,0
3,15619304,Onio,502,France,Female,42,8,159660.8,3,1,0,113931.57,1
4,15701354,Boni,699,France,Female,39,1,0,2,0,0,93826.63,0
5,15737888,Mitchell,850,Spain,Female,43,2,125510.82,1,1,1,79084.1,0
6,15574012,Chu,645,Spain,Male,44,8,113755.78,2,1,0,149756.71,1
7,15592531,Bartlett,822,France,Male,50,7,0,2,1,1,10062.8,0
8,15656148,Obinna,376,Germany,Female,29,4,115046.74,4,1,0,119346.88,1
9,15792365,He,501,France,Male,44,4,142051.07,2,0,1,74940.5,0
10,15592389,H?,684,France,Male,27,2,134603.88,1,1,1,71725.73,0
11,15767821,Bearce,528,France,Male,31,6,102016.72,2,0,0,80181.12,0
12,15737173,Andrews,497,Spain,Male,24,3,0,2,1,0,76390.01,0
13,15632264,Kay,476,France,Female,34,10,0,2,1,0,26260.98,0
14,15691483,Chin,549,France,Female,25,5,0,2,0,0,190857.79,0
15,15600882,Scott,635,Spain,Female,35,7,0,2,1,1,65951.65,0
16,15643966,Goforth,616,Germany,Male,45,3,143129.41,2,0,1,64327.26,0
17,15737452,Romeo,653,Germany,Male,58,1,132602.88,1,1,0,5097.67,1
18,15788218,Henderson,549,Spain,Female,24,9,0,2,1,1,14406.41,0
19,15661507,Muldrow,587,Spain,Male,45,6,0,1,0,0,158684.81,0
20,15568982,Hao,726,France,Female,24,6,0,2,1,1,54724.03,0
21,15577657,McDonald,732,France,Male,41,8,0,2,1,1,170886.17,0
22,15597945,Dellucci,636,Spain,Female,32,8,0,2,1,0,138555.46,0
23,15699309,Gerasimov,510,Spain,Female,38,4,0,1,1,0,118913.53,1
24,15725737,Mosman,669,France,Male,46,3,0,2,0,1,8487.75,0
25,15625047,Yen,846,France,Female,38,5,0,1,1,1,187616.16,0
26,15738191,Maclean,577,France,Male,25,3,0,2,0,1,124508.29,0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!