How do I write this java program in hashmap? The program should create charts showing the consistency of the two judges. The rows represent the scores given by Dr. Stansifer and the columns represent the scores given by Dr. Shoaff. Suppose the maximum score is 3 the judges give the following scores. Manatee ID Dr. Shoaff's Score Dr. Stansifier's Score 1 0 0 23 0 3 14 0 0 5 3 0 19 2 3 18 1 1 12 3 2 204 1 1 6 0 0 25 3 3 The consistency chart resulting from these scores are: 0 1 2 3 0 3 0 0 1 1 0 2 0 0 2 0 0 0 1 3 1 0 1 1 The "3" in the upper left hand corner indicates that there were 3 manatees that Dr Shoaff and Dr Stansifer gave a 0 score. (namely manatee 1, 14, 6). The 1 in row 0, column 1 indicates there was 1 manatee that Dr. Shoaff scored a 0 while Dr Stansifer scores a 3 (namely manatee 23). Ideally the only non-zero entries in the table would be along the diagonal indicating perfect consistency. Your program should take a group of scores and build the corresponding table. Sample Input The input to the program will consist of one or more data sets. Each data sets will begin with a single integer, max where 0 ≤max
How do I write this java
The program should create charts showing the consistency of the two judges. The rows represent the scores given by Dr. Stansifer and the columns represent the scores given by Dr. Shoaff. Suppose the maximum score is 3 the judges give the following scores.
Manatee ID | Dr. Shoaff's Score | Dr. Stansifier's Score |
---|---|---|
1 | 0 | 0 |
23 | 0 | 3 |
14 | 0 | 0 |
5 | 3 | 0 |
19 | 2 | 3 |
18 | 1 | 1 |
12 | 3 | 2 |
204 | 1 | 1 |
6 | 0 | 0 |
25 | 3 | 3 |
The consistency chart resulting from these scores are:
0 | 1 | 2 | 3 | |
---|---|---|---|---|
0 | 3 | 0 | 0 | 1 |
1 | 0 | 2 | 0 | 0 |
2 | 0 | 0 | 0 | 1 |
3 | 1 | 0 | 1 | 1 |
The "3" in the upper left hand corner indicates that there were 3 manatees that Dr Shoaff and Dr Stansifer gave a 0 score. (namely manatee 1, 14, 6). The 1 in row 0, column 1 indicates there was 1 manatee that Dr. Shoaff scored a 0 while Dr Stansifer scores a 3 (namely manatee 23). Ideally the only non-zero entries in the table would be along the diagonal indicating perfect consistency. Your program should take a group of scores and build the corresponding table.
Sample Input
The input to the program will consist of one or more data sets. Each data sets will begin with a single integer, max where 0 ≤max <e; 20, the maximum score a manatee may receive. There will be one or more lines representing the scores given by the judges. They will be in the following format
judge manateeNumber score
where:
- Judge is a single letter, "H", "W","E", "H" representing Dr. Shoaff's score, "W" representing Dr. Stansifer's score, and "E" marking the end of scores for this dataset.
- manatee is a postive number representing the manatee number
- score is a integer, 0 ≤score ≤ max
The end of input will be indicated by the data-set will max ≤ 0. This is not another data set, and should not be processed.
3 H 1 0
H 19 2
W 25 3
H 12 3
H 204 1
H 6 0
W 1 0
H 5 3
H 25 3
W 23 3
W 14 0
W 5 0
W 19 3
H 23 0
W 18 1
H 14 0
H 18 1
W 12 2
W 204 1
W 6 0
H 10 2
W 100 2
E 0 0
Sample Output
The consistency matrix should be printed in row major order, one row per line, with one blank between each pair of consective entries. Only manatees which have been scored by both judges should be included in the consistency matrix. There should be a blank line after the consistency matrix for each data set.
3 0 0 1
0 2 0 0
0 0 0 1
1 0 1 1
Trending now
This is a popular solution!
Step by step
Solved in 4 steps