Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

the language is java language Please add annotation explaining each part please answer as soon as possible This may help values for topovalues FP1 -17.926

the language is java language

Please add annotation explaining each part

please answer as soon as possible

This may help

image text in transcribed

values for topovalues

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 TopographyArray. This class will be used to store data from topovalues.txt. Furthermore, 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. Add a method called readTopographyArray. This method should read the data from the file into the two-dimensional array you created in 2A. The first dimension should be equal to the number of rows in the file, the second to the number of (tab separated) columns.

c)

image text in transcribed

image text in transcribed

d)

image text in transcribed

image text in transcribed

if anyone sees the answer to this please change it a bit.

This exercise involves reading data from a file storing the data in a two dimensional array. implementing methods that perform operations on the data and implementing a command line user interface. You will find the data needed for the visualisation in a file called topovalues.txt. The data rows and columns that are separated by tabs. See an example in the table below Electrode name Angle Radius Amplitude FC4 62.42 0.28822 0.0714 FC6 69.332 0.40823 0.10099 FT8 71.948 0.53192 0.10254 Electrode name Angle Radius Amplitude -90 0.53318 0.034154 CS 0.3999 0.0080936 The first column contains the label names. The position is defined in so called Polar Coordinates that consist of an angle and a radius. The final column contains the amplitude measured at this electrode Polar coordinates are an alternative to the Cartesian Coordinates. They are particularly useful to define positions in concentric circles. This is what we want to do with our electrodes as we approximate the head of a participant using a simple sphere. Cartesian coordinates can be calculated from polar coordinates using the following equations: Xarcos yursing Conversely Cartesian coordinates can be transformed to polar coordinates: aanly.) Add the following functions to access the data. See the comments in the code below regarding the functionality that should be provided by your implementation. public String get Topography(){ / Construct a single string that contains all the electrode labels from the file in one line. Return this string. */ } public double getAngle(String label){ 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){ 3 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) { 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. PROTOCO US parameter. MORE Sure you 0 TOL CORE We Suce surrounding the label or capitalisation of the letters into account. */ } public String getClosestLabel (double angle, double radius) { /* Get the label closest to the angle and radius provided as parameter. Return this label as a String. */ Now create a class called MainExercise2 with a main() method. Add code to the main() method that will prompt the user to enter a 1 (numeric one) to print the electrode labels, a label to retrieve the corresponding angle, radius and amplitude, an angle and radius to retrieve the closest label or quit to quit. This prompt should query the user for new inputs until the user enters "quit". You should verify that the input is a valid and the choice of output should be derived from the input. An example of the output could look like this: Please enter: - 1 to print electrode labels . a label to retrieve angle radius and amplitude of this electrode - an angle/radius pair to retrieve the closest label quit to quit. 12 Invalid input! Please enter: - 1 to print electrode labels a label to retrieve angle radius and amplitude of this electrode an angle/radius pair to retrieve the closest label - quit to quit. Invalid input! Please enter: . 1 to print electrode labels - a label to retrieve angle radius and amplitude of this electrode . an angle/radius pair to retrieve the closest label quit to quit. F3 Retrieving amplitude for label F3... Angle: -39.947 Radius: 0.3446 Amplitude: 0.05663 Please enter: 1 to print electrode labels a label to retrieve angle radius and amplitude of this electrode . an angle/radius pair to retrieve the closest label quit to quit. Printing electrode labels... FP1 FPZ FP2 AF7 AF3 AF4 AF8 F7 F5 F3 F1 FZ F2 F4 F6 F8 FT7 FC FC3 FCI FCZ FC2 FC4 FC6 FT8 T7 C5 C3 C1 C2 C2 C4 C6 T8 TP7 CP5 CP3 CP1 CPZ CP2 CP4 CP6 TP8 P7 PS P3 P1 PZ P2 P4 P6 P8 POZ PO3 POS POZ PO4 P06 P08 01 OZ 02 Please enter: . 1 to print electrode labels . a label to retrieve angle radius and amplitude of this electrode . an angle/radius pair to retrieve the closest label quit to quit. 45 0.5 Retrieving closest label to angle 45 and radius 0.5... F6 Please enter: i to print electrode labels . a label to retrieve angle radius and amplitude of this electrode - an angle/radius pair to retrieve the closest label quit to quit. quit Bye

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

SQL Server Query Performance Tuning

Authors: Sajal Dam, Grant Fritchey

4th Edition

1430267429, 9781430267423

More Books

Students also viewed these Databases questions

Question

Why are money market securities often called cash equivalents? L658

Answered: 1 week ago