import java.util.*;    public

import java.util.*;  public class DataAnalysis{

   static Set<String> Data_NaN(Set<String>set){       Set<String> set2 = newHashSet<String>();   for (String temp : set) {       temp = temp.replaceAll(       “[^0-9]”, “”);                if(!(set.isEmpty())){          set2.add(temp);       }   }   return set2;             }public static void main(String args[]){// create empty setSet<String> set = new HashSet<String>();// {3, 25, 33, 21, 55, 43, 78, 31, 33, 75, 43, 11, 36, 4, 10, 99,A, B, C}// add values one by one in setset.add(“03”);set.add(“25”);set.add(“33”);set.add(“21”);set.add(“55”);set.add(“43”);set.add(“78”);set.add(“31”);set.add(“33”);set.add(“75”);set.add(“43”);set.add(“11”);set.add(“36”);set.add(“04”);set.add(“10”);set.add(“99”);set.add(“A”); set.add(“B”); set.add(“C”);// print input setSystem.out.println(“Set: ” + set);// call funtion Data_NaN to filter out non-numerical dataSystem.out.println(“After filtering nonnumerical data- Set:”+Data_NaN(set));// call funtion Data_Min to calculate min valueSystem.out.println(“Minimum number from set is=”+Data_Min(set));  }   static String Data_Min(Set<String> set) {       String obj =Collections.min(set);         return obj;   }}

output: After filtering nonnumerical data: [33, 55, 11, 99, ,78, 25, 36, 3, 4, 31, 75, 21, 43, 10]Minimum value After filtering nonnumerical data:Question:. this is a dataset given{3, 25, 33, 21, 55, 43, 78, 31,33, 75, 43, 11, 36, 4, 10, 99, A, B, C} why Data min method doesnot print any thing? I need to find maximum value, average value,median, mode, order it small to large using numerical data of givendataset in separate methods.

Answer:

import java.util.*;public class DataAnalysis {        static Set<String> Data_NaN(Set<String> set) {                Set<String> set2 = new HashSet<String>();                for (String temp : set) {                        temp = temp.replaceAll("[^0-9]", "");                        if (!(set.isEmpty())) {                                set2.add(temp);                        }                }                return set2;        }        public static void main(String args[]) {// create empty set                Set<String> set = new HashSet<String>();// {3, 25, 33, 21, 55, 43, 78, 31, 33, 75, 43, 11, 36, 4, 10, 99, A, B, C}// add values one by one in set                set.add("03");                 set.add("25");                set.add("33");                set.add("21");                set.add("55");                set.add("43");                set.add("78");                set.add("31");                set.add("33");                set.add("75");                set.add("43");                set.add("11");                set.add("36");                set.add("04");                 set.add("10");                set.add("99");                set.add("A");                set.add("B");// print input set                System.out.println("Set: " + set);// call funtion Data_NaN to filter out non-numerical data                System.out.println("After filtering nonnumerical data- Set: " + Data_NaN(set));// call funtion Data_Min to calculate min value                System.out.println("Minimum number from set is= " + Data_Min(Data_NaN(set)));        }        static String Data_Min(Set<String> set) {                // here it will compare the numbers as strings so we will not get the correct                // so we should convert it as int and find min                int min = Integer.MAX_VALUE;                for (String s : set) {                        if (s.trim().length() != 0) {                                int i = Integer.parseInt(s);                                if (i < min)                                        min = i;                        }                }                return Integer.toString(min);        }}

NOTE : PLEASE COMMENT BELOW IF YOU HAVE CONCERNS.

I AM HERE TO HELP YOUIF YOU LIKE MY ANSWER PLEASE RATE AND HELPME IT IS VERY IMP FOR ME


 
"Our Prices Start at $11.99. As Our First Client, Use Coupon Code GET15 to claim 15% Discount This Month!!"

Calculate your order
Pages (275 words)
Standard price: $0.00
Client Reviews
4.9
Sitejabber
4.6
Trustpilot
4.8
Our Guarantees
100% Confidentiality
Information about customers is confidential and never disclosed to third parties.
Original Writing
We complete all papers from scratch. You can get a plagiarism report.
Timely Delivery
No missed deadlines – 97% of assignments are completed in time.
Money Back
If you're confident that a writer didn't follow your order details, ask for a refund.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
Power up Your Academic Success with the
Team of Professionals. We’ve Got Your Back.
Power up Your Study Success with Experts We’ve Got Your Back.