Question
This is java could someone please answer exercise 1 This file is called topoV.txt theses are the contents of it FP1 -17.926 0.51499 0.10919 FPZ
This is java
could someone please answer exercise 1
This file is called topoV.txt
theses are the contents of it
FP1 -17.926 0.51499 0.10919 FPZ 0 0.50669 0.12384 FP2 17.926 0.51499 0.12537 AF7 -35.892 0.52233 0.10174 AF3 -22.461 0.42113 0.083732 AF4 22.461 0.42113 0.10766 AF8 35.858 0.52231 0.13148 F7 -53.913 0.52808 0.092015 F5 -49.405 0.4316 0.07714 F3 -39.947 0.3446 0.05663 F1 -23.493 0.27903 0.047246 FZ 0 0.25338 0.060621 F2 23.493 0.27878 0.068389 F4 39.897 0.3445 0.097508 F6 49.405 0.43128 0.12917 F8 53.867 0.52807 0.12824 FT7 -71.948 0.53192 0.063585 FC5 -69.332 0.40823 0.04354 FC3 -62.425 0.28822 0.020697 FC1 -44.925 0.18118 0.013025 FCZ 0 0.12662 0.01985 FC2 44.925 0.18118 0.033945 FC4 62.425 0.28822 0.0714 FC6 69.332 0.40823 0.10099 FT8 71.948 0.53192 0.10254 T7 -90 0.53318 0.034154 C5 -90 0.3999 0.0080936 C3 -90 0.26669 0.0064161 C1 -90 0.13319 0.012379 CZ 0 0 0.021375 C2 90 0.13348 0.007836 C4 90 0.26667 0.030224 C6 90 0.3999 0.049915 T8 90 0.53318 0.071613 TP7 -108.05 0.53192 0.021104 CP5 -110.67 0.40823 0.042555 CP3 -117.58 0.28822 0.080197 CP1 -135.08 0.18118 0.12138 CPZ 180 0.12662 0.18248 CP2 135.08 0.18118 0.054668 CP4 117.58 0.28822 0.018648 CP6 110.67 0.40823 0.0075666 TP8 108.11 0.53191 0.01292 P7 -126.09 0.52808 0.1193 P5 -130.59 0.4316 0.16637 P3 -140.05 0.3446 0.20009 P1 -156.51 0.27903 0.28611 PZ 180 0.25338 0.39661 P2 156.51 0.27878 0.19522 P4 140.1 0.3445 0.09266 P6 130.59 0.43128 0.044631 P8 126.13 0.52807 0.015682 PO7 -144.11 0.52233 0.17253 PO3 -157.54 0.42113 0.20308 PO5 -149.46 0.4665 0.18358 POZ 180 0.37995 0.21287 PO4 157.54 0.42113 0.12758 PO6 149.46 0.4665 0.064723 PO8 144.14 0.52231 0.059771 O1 -162.07 0.51499 0.079895 OZ 180 0.50669 0.04594 O2 162.07 0.51499 0.042728
a)
create a class called TAarray, this will store the values of the topV.txt
add a private two-dimensional array of type Object.
b)
Add a constructor to the class. The constructor should receive a String as parameter that contains the name of the file.
you will need to create a constructor to add to the class. The constructor should receive a string as parameter that contains the name of the file.
After this you should make a method called readTArray. The purpose of this is to read the data from the file into a two dimensional array which you created in a). The dimension should be the same as the number of rows in the file, the second should be the number of separated columns.
c)
add these functions
public String getT{
}
for this function, you should Construct a single string that contains all the electrode labels from the file in one line. Return this string.
public double getAngle(String label){
}
for this Get the angle of the electrode position defined by the label provided as a parameter. Make sure you do not take white space surrounding the label or capitalisation of the letters into account.
public double getRadius(String label){
}
for this Get the radius of the electrode position defined by the label provided as a parameter. Make sure you do not take white space surrounding the label or capitalisation of the letters into account.
public double getAmplitude(String label){
}
you have to get the amplitude at the electrode position defined by the label provided as a parameter. Make sure you do not take white space surrounding the label or capitalisation of the letters into account
public String getClosestLabel(double angle, double radius){
}
finally, for this Get the label closest to the angle and radius provided as parameter. Return this label as a String.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started