Question: Hello guys, i have a problem to solve but i am facing some problems. I need to create a java OOP program and i would
Hello guys, i have a problem to solve but i am facing some problems. I need to create a java OOP program and i would really appreciate if you guys could help me out
This program is something similar to a dynamic table that gives the same operations as SUM, COUNT, AVG, MIN and MAX
First we need to insert the name of the csv file that we want to open, then we need to choose the column name 1 and column name 2 separeted by a "," , then we need to insert the operations we want to do for example SUM and then we need to insert the column name that have the values we want to SUM, i will leave some input and output examples at the end of the question and will leave the csv file.
Generic ex:
Input:
F // File name
Column1,Column2
SUM //Operation
A // Column where are the values we want to 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 gener is female and from france, all the values of tenure where the gener is male and from france, all the values of tenure where the gener is male and from germany, all the values where the gener is female and from german and soo on
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 23 lines of the file, thank you very much for those who can help me !

P 5 9 A B E F . 1 K M N 1 RowNumber,Customerld, Surname CreditScore, Geography, Gender,Age, Tenure, Balance, NumOfProducts, HasCrCard, IsActiveMember, EstimatedSalary,Exited 2 1,15634602, Hargrave,619, France, Female, 42,2,0,1,1,1,101348.88,1 3 2,15647311, Hill,608,Spain, Female, 41,1,83807.86,1,0,1,112542.58,0 4 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 6 5,15737888, Mitchell,850, Spain, Female,43,2,125510.82,1,1,1,79084.1,0 7 6,15574012, Chu, 645,Spain, Male, 44,8,113755.78,2,1,0,149756.71,1 8 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 10 9,15792365, He,501, France, Male,44,4,142051.07,2,0,1,74940.5,0 11 10,15592389,H?,684,France, Male,27,2,134603.88,1,1,1,71725.73,0 12 11,15767821, Bearce,528, France, Male,31,6,102016.72,2,0,0,80181.12,0 13 12,15737173, Andrews,497,Spain, Male, 24,3,0,2,1,0,76390.01,0 14 13,15632264, Kay, 476, France, Female, 34,10,0,2,1,0,26260.98,0 15 14,15691483,Chin,549, France, Female,25,5,0,2,0,0,190857.79,0 16 15,15600882,Scott,635,Spain, Female, 35,7,0,2,1,1,65951.65,0 17 16,15643966, Goforth, 616, Germany, Male,45,3,143129.41,2,0,1,64327.26,0 18 17,15737452,Romeo,653, Germany, Male,58,1,132602.88,1,1,0,5097.67,1 19 18,15788218,Henderson,549,Spain, Female, 24,9,0,2,1,1,14406.41,0 20 19,15661507, Muldrow,587,Spain, Male,45,6,0,1,0,0,158684.81,0 21 20,15568982,Hao,726, France, Female, 24,6,0,2,1,1,54724.03,0 22 21,15577657, McDonald,732, France, Male,41,8,0,2,1,1,170886.17,0 22 22 15507015 nollici 606 Crain Comalo 2200 210120555 16 0 P 5 9 A B E F . 1 K M N 1 RowNumber,Customerld, Surname CreditScore, Geography, Gender,Age, Tenure, Balance, NumOfProducts, HasCrCard, IsActiveMember, EstimatedSalary,Exited 2 1,15634602, Hargrave,619, France, Female, 42,2,0,1,1,1,101348.88,1 3 2,15647311, Hill,608,Spain, Female, 41,1,83807.86,1,0,1,112542.58,0 4 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 6 5,15737888, Mitchell,850, Spain, Female,43,2,125510.82,1,1,1,79084.1,0 7 6,15574012, Chu, 645,Spain, Male, 44,8,113755.78,2,1,0,149756.71,1 8 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 10 9,15792365, He,501, France, Male,44,4,142051.07,2,0,1,74940.5,0 11 10,15592389,H?,684,France, Male,27,2,134603.88,1,1,1,71725.73,0 12 11,15767821, Bearce,528, France, Male,31,6,102016.72,2,0,0,80181.12,0 13 12,15737173, Andrews,497,Spain, Male, 24,3,0,2,1,0,76390.01,0 14 13,15632264, Kay, 476, France, Female, 34,10,0,2,1,0,26260.98,0 15 14,15691483,Chin,549, France, Female,25,5,0,2,0,0,190857.79,0 16 15,15600882,Scott,635,Spain, Female, 35,7,0,2,1,1,65951.65,0 17 16,15643966, Goforth, 616, Germany, Male,45,3,143129.41,2,0,1,64327.26,0 18 17,15737452,Romeo,653, Germany, Male,58,1,132602.88,1,1,0,5097.67,1 19 18,15788218,Henderson,549,Spain, Female, 24,9,0,2,1,1,14406.41,0 20 19,15661507, Muldrow,587,Spain, Male,45,6,0,1,0,0,158684.81,0 21 20,15568982,Hao,726, France, Female, 24,6,0,2,1,1,54724.03,0 22 21,15577657, McDonald,732, France, Male,41,8,0,2,1,1,170886.17,0 22 22 15507015 nollici 606 Crain Comalo 2200 210120555 16 0
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
