Question: Java Program Write a program to analyze a log file to get the 50 percentile of the E values when the field is_safe equals to
Java Program
Write a program to analyze a log file to get the 50 percentile of the "E" values when the field "is_safe" equals to 1. The following are two example records from the log: batch O||is_safe:0,E=100;is_safe:1,E=101;&&batch 2||is_safe:0,E=100;is_safe:1,E=102;is_safe:1, E=12; - - The records are separated by && - Please infer other formatting rules from these two example records The first record is_safe equals to O so the record should be ignored in calculation. The second record has is_safe=1, so the E value 102 should be included in calculation. For this particular example, there are 3 E values with is_safe=1 (12,101,102), so the final output should be 101. If the number of observations is even, then the 50 percentile is the simple average of the middle two numbers. Please note: There might be malformed lines, you should discard the entire line if you detect any errors (for example extra spaces thats different from the example above)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
