Write a JAVA program to read the following file (inputFile.txt) as input and display the output on console as shown below: (Note: The number of records and data in the file may be different each time you read the file. So, you have to handle it accordingly.)
Sample "inputFile.txt"
(The attribute values in each row are separated by @ symbol. Following is the description of the attributes in each record from left-right in order)
gender -the child’s sex
age -the mother’s age at birth
race -the mother’s race
parity -prior number of children in family
bwt -birthweight (grams)
==============
F@31@hispanic@4@3118
M@23@white@0@3466
F@24@black@1@3147
M@26@hispanic@2@3969
M@34@white@0@3005
M@15@black@0@2920
F@24@asian@4@3260
M@30@white@1@4451
F@23@asian@0@3106
F@37@white@2@3345
F@20@white@0@2580
F@35@asian@0@3118
F@28@black@0@3005
F@22@white@0@3742
F@26@white@3@4054
F@23@black@0@3062
M@36@black@2@2325
M@32@other@2@3345
M@24@white@1@3260
M@18@hispanic@0@3459
F@26@asian@1@3515
F@27@white@2@3629
F@17@black@0@3544
F@26@hispanic@3@4167
F@32@hispanic@2@3402
M@35@hispanic@0@3374
M@39@asian@2@3118
F@27@white@1@3580
F@31@hispanic@2@3374
M@38@white@0@2948
M@18@hispanic@0@3487
F@16@asian@0@3118
F@40@white@4@3402
F@26@asian@0@1361
M@17@white@0@3402
F@29@hispanic@1@3572
M@30@white@3@3785
F@30@hispanic@3@3969
M@36@white@3@4196
F@23@white@1@2778
F@18@white@1@3289
F@23@black@1@3147
F@19@white@0@2835
M@23@white@4@3544
M@27@black@2@3459
M@25@white@2@2977
M@20@asian@0@2637
F@31@white@0@3487
M@21@asian@1@3912
M@20@other@0@2977
F@30@white@3@3941
M@20@black@0@2410
F@31@hispanic@0@3175
F@20@hispanic@0@2750
M@22@hispanic@1@2948
M@23@black@0@3260
M@29@white@1@3657
M@20@asian@0@3884
F@24@asian@0@2608
M@36@hispanic@1@4451
M@29@white@4@3969
F@25@asian@0@2892
M@20@white@0@3912
M@18@white@0@2534
M@26@white@1@3856
M@38@hispanic@5@2126
F@21@asian@2@3317
M@28@white@2@3430
M@21@hispanic@0@2807
F@26@white@3@3226
M@18@hispanic@1@3544
F@16@white@0@3080
M@38@white@0@3515
M@18@hispanic@0@4054
M@26@white@0@3827
M@34@white@2@3720
M@32@white@2@3566
F@31@black@1@2977
M@21@white@0@4132
F@30@white@2@2816
F@16@white@0@3487
M@23@white@1@3572
M@19@other@0@3487
M@31@asian@2@3714
F@20@white@0@3345
M@22@white@0@3317
M@33@hispanic@1@3600
M@37@asian@0@4139
F@27@black@2@2551
M@24@white@1@4719
M@29@black@3@3969
M@19@white@0@1588
M@25@hispanic@0@3629
F@21@hispanic@2@3232
F@24@white@1@3515
M@18@hispanic@0@2977
M@37@white@1@2637
M@27@white@0@2920
M@36@hispanic@2@1843
F@21@hispanic@0@3175
==============
Sample output at console or JOptionPane should be as under after reading the file
Total records found: [mention here the number of total records]
Total female children records: [mention here the number of total records of female gender]
Children under 2000 grams: [mention here the number of records of children under 2000 grams]
Records with mother age <= 16 & child weight under 2000 grams: [mention here the number of records of children under 2000 grams and where the mother age is less than or equal to 16]
==============
[CLO2,PLO30]
Answers
Answered by
2
Answer:
What is this
What you wrote
Similar questions