Create the metric distance md program what is a metric


Assignment

Metric Distance

Create the Metric Distance (MD) Program. What is a "metric distance". Given a set of metrics, m1, m2, m3... mn, for a set of modules (records), determine the similarity (distance) among the modules in the set by comparing the individual values of the n metrics. The output will be the smallest distances between all records.

Input to the program will be a file (MD_input_file) in following text format:

• Number_of records Number_of_metrics - the first line of the input file determines the size of the input file - note they are integers.

• The rest of the file will be individual records beginning with the module name followed by values for each of the number of metrics. Each module name should be distinct for our testing so that final outputs can be easily compared. Note in reality this is not a hard rule, because depending on scope names can be reused in programs.

Error processing and error reporting should be handled by one module, MD_error(char *message, enum type, int severity);

For example in checking the format of the first line of MD_input_file, if the first line does not contain two integers, report the error,

Misspellings in the error message will be counted as an error!

MD_error("Error, expecting the number of records and number of metrics for each record", FILE_FORMAT_ERROR, PROGRAM_EXIT).

Analyze the types of errors that can occur in your program and create an enumerated type for each. For severity, basically there are two types, one that has the program stop (PROGRAM_EXIT) and one that reports the error and then continues, PROGRAM_CONTINUE).

For the "body" of the file, if a record does not contain the correct number of fields, one field for the name of module (realize the name can be a list of digits) followed by the correct number of metrics, report the number of the incorrect record and a message indicating incorrect format). The message should indicate the problem, so it can be corrected the user.

If the file does not contain the correct number of records, this is also an error. Again indicate the number of records read and the number expected.

Request for Solution File

Ask an Expert for Answer!!
JAVA Programming: Create the metric distance md program what is a metric
Reference No:- TGS02260656

Expected delivery within 24 Hours