Menu

(Solved) : Java Someone Please Help Asap Examples Files Need Please Let Know Thank Understanding Data Q37194886 . . .

JAVA

Someone please help me with this ASAP!!!!!!! There are examplesof the files, but if you need them, please let me know! Thankyou!

Understanding the Data

  1. Inside the Intellij project folder there are 7 data files. Sixof these are city data files and one is a list of the measurementsfrom the health survey. The files are organized as follows.

  2. File “questions.txt”

    1. (a) This file is the list of measurements from the healthsurvey. There is one measurement on each line of the file. Theseare the measures that will be presented as a menu for the user’schoice. Here is an example of the first and last lines in thefile.

      Current lack of health insurance among adults aged 18–64 YearsArthritis among adults aged >=18 Years

      Sleeping less than 7 hours among adults aged >=18 Years

      All teeth lost among adults aged >=65 Years

    2. (b) These measures are not stored in the city data files, wherethey are instead referenced by an integer code, known as a key. Ina city data file, the measure key 1 refers to the first measure inthe measures file “Current lack of health insurance among adultsaged 18–64 Years”, the measure key 2 refers to the second measurein the measures file “Arthritis among adults aged >=18 Years”,etc. As there are 28 measures in the file, 28 is the key for “Allteeth lost among adults aged >=65 Years”.

  3. City Data Files

    1. (a) For this assignment, the city data files will be limited tohealth survey data of six Louisiana cities.

    2. (b) “br.txt” contains Baton Rouge data, “ken.txt” containsKenner data, “laf.txt” contains Lafayette data, “lc.txt” containsLake Charles data, “nola.txt” contains New Orleans data and“sp.txt” contains Shreveport data.

    3. (c) Data in these city files is organized as follows:

      1. Line one contains the name of the state of the city.

      2. Line two contains the abbreviation of the state of the city.

      3. Line three contains the name of the city.

      4. Lines four and all the lines that follow are organized in fieldsof numbers, each separated by a single space, essentially makingcolumns of data in the file. These fields are:

A. field 1: B. field 2:

C. field 3: D. field 4:

E. field 5: F. field 6: G. field 7:

sample size percentage

lower confidence upper confidence

latitude longitude measure key

int; the number of people in the area sampled

double; the percent result of the survey; stored in the form##.# (example 50.2 is 50.2 percent)

double; the lower bounds of confidence in the percentage; storedin the form ##.# (example 50.2 is 50.2 percent)

double; the upper bounds of confidence in the percentage; storedin the form ##.# (example 50.2 is 50.2 percent)

central latitude of the sample area
central longitude of the sample area
the code (key) of the measure of the survey results

3 (d) Example of data of in a city file:

Louisiana LA Lafayette 3351 22.4 18.9 26.3 30.2248618566 -92.0194019578 1 2257 22.1 18.7 25.5 30.2199540086 -92.0033645168 1 2503 10.7 8.1 14 30.2153844022 -92.0340798419 1 … 1026 68.2 63.9 72 30.1527301524 -91.9851212329 12 686 65.7 61.4 69.6 30.1833232633 -91.9958805141 12 5287 69.8 65.6 73.4 30.1985462427 -92.028270898 12 … 4064 13.4 7.5 20.5 30.1965012966 -92.0818885855 28 239 14.8 9 22 30.1750365398 -92.0865055008 28 6329 14.2 9.9 19.6 30.20913162 -92.0206656257 28

Make a class to hold one line of survey data for a city.

  1. The survey data is found on lines four to a city file’s end.

  2. This will be an immutable class. This means it has no setter(mutator) methods, only fields, constructors and getter (accessor)methods.

  3. Create the class and file in the project as usual, then

    1. (a) add a private field for each of the seven fields on linefour (and beyond) of a city file as described in “Understanding theData” 3.c.iv.

    2. (b) Add a constructor that accepts the values for the fields andassigns valid values. The limits are as follows.

      1. sample size must be 0 or greater

      2. percentage, lower confidence and upper confidence must be in therange [0, 100], i. e. 0 to 100 inclusive

      3. latitude must be in the range [25,50], i. e. 25 degrees north to50 degrees north to belong to a city in the “lower 48” states

      4. longitude must be in the range [-65,-130], i. e. -65 degrees to-130 degrees to belong to a city in the “lower 48” states; negativelongitudes indicate west of the prime meridian

      5. measure key must be a value in the range [1,28], i. e. 1 to 28inclusive

    3. (c) create a getter (accessor) for each of the private datafields

    4. (d) as a parametrized constructor exists, a default constructormust be created, even if it is empty of any code

Make a City Class

  1. This too will be an immutable class. This means it has no setter(mutator) methods, only fields, constructors and getter (accessor)methods.

  2. Create the class in the project as usual, then
    (a) inherit class State
    (b) add a private field for the city name and add a getter(accessor) method(c) add a private ArrayList field
    (d) create a default constructor
    (e) create a parametrized constructor

    1. this constructor receives a single parameter of type Scannerthat references an existing Scannerclass object that references acity file

    2. using the Scanner class object, read in the name of the state,state abbreviation, and city name, then loop through the rest ofthe file reading in the city survey data

      A. for every line of survey data read, create an object of thesurvey data class and store it in theArrayList field

    (f) create methods to

    1. return the total population of the city (hint: arbitrarilyselect a measure to sum)

    2. receive a measure key and return the average percent (mean ofthe survey results) for that measure

    3. receive a measure key and return the average upper confidence(mean of the survey upper confidence) for that measure

    4. receive a measure key and return the average lower confidence(mean of the survey upper confidence) for that measure

    5. return the average latitude

    6. return the average longitude

Create the User Interface

  1. The user must input the file to use.

  2. Create a Scanner class object and pass it to the city classconstructor so the correct city file can be read.

  3. Call methods to show the state, state abbreviation and cityname.

  4. Create a Scanner class object and use it to read “questions.txt”(the measures file). Tip: Load the measures into an ArrayList forrepeated use.

  5. Display the measures as a menu and the average percentage andconfidence results from the user’s selection.

6. Continue to prompt the user for a measure until the userdecides to exit.

Example Run (user input in bold)

Enter city file path: laf.txt

Lafayette Louisiana LA population: 120623 avg lat: 30.20491668384118 avg long: -92.03661815420294

1: Current lack of health insurance among adults aged 18–64Years 2: Arthritis among adults aged >=18 Years
3: Binge drinking among adults aged >=18 Years
4: High blood pressure among adults aged >=18 Years

5: Taking medicine for high blood pressure control among adultsaged >=18 Years with high blood pressure
6: Stroke among adults aged >=18 Years
7: Cancer (excluding skin cancer) among adults aged >=18Years

8: Current asthma among adults aged >=18 Years
9: Coronary heart disease among adults aged >=18 Years
10: Visits to doctor for routine checkup within the past Year amongadults aged >=18 Years
11: Cholesterol screening among adults aged >=18 Years
12: Fecal occult blood test sigmoidoscopy or colonoscopy amongadults aged 50–75 Years
13: Chronic obstructive pulmonary disease among adults aged >=18Years 14: Older adult men aged >=65 Years who are up to date ona core set of clinical preventive services: Flu shot past Year PPVshot ever Colorectal cancer screening
15: Older adult women aged >=65 Years who are up to date on acore set of clinical preventive services: Flu shot past Year PPVshot ever Colorectal cancer screening and Mammogram past 2Years
16: Current smoking among adults aged >=18 Years
17: Visits to dentist or dental clinic among adults aged >=18Years
18: Diagnosed diabetes among adults aged >=18 Years
19: High cholesterol among adults aged >=18 Years who have beenscreened in the past 5 Years
20: Chronic kidney disease among adults aged >=18 Years
21: No leisure-time physical activity among adults aged >=18Years
22: Mammography use among women aged 50–74 Years
23: Mental health not good for >=14 days among adults aged>=18 Years 24: Obesity among adults aged >=18 Years
25: Papanicolaou smear use among adult women aged 21–65 Years
26: Physical health not good for >=14 days among adults aged>=18 Years 27: Sleeping less than 7 hours among adults aged>=18 Years
28: All teeth lost among adults aged >=65 Years
Measure? 13

avg value:avg lower:avg upper:7.33%6.31%8.43%

Continue? (Y/N) y

1: Current lack of health insurance among adults aged 18–64Years 2: Arthritis among adults aged >=18 Years
3: Binge drinking among adults aged >=18 Years
4: High blood pressure among adults aged >=18 Years

5: Taking medicine for high blood pressure control among adultsaged >=18 Years with high blood pressure
6: Stroke among adults aged >=18 Years
7: Cancer (excluding skin cancer) among adults aged >=18Years

8: Current asthma among adults aged >=18 Years
9: Coronary heart disease among adults aged >=18 Years
10: Visits to doctor for routine checkup within the past Year amongadults aged >=18 Years
11: Cholesterol screening among adults aged >=18 Years
12: Fecal occult blood test sigmoidoscopy or colonoscopy amongadults aged 50–75 Years
13: Chronic obstructive pulmonary disease among adults aged >=18Years 14: Older adult men aged >=65 Years who are up to date ona core set of clinical preventive services: Flu shot past Year PPVshot ever Colorectal cancer screening
15: Older adult women aged >=65 Years who are up to date on acore set of clinical preventive services: Flu shot past Year PPVshot ever Colorectal cancer screening and Mammogram past 2Years
16: Current smoking among adults aged >=18 Years
17: Visits to dentist or dental clinic among adults aged >=18Years
18: Diagnosed diabetes among adults aged >=18 Years
19: High cholesterol among adults aged >=18 Years who have beenscreened in the past 5 Years
20: Chronic kidney disease among adults aged >=18 Years
21: No leisure-time physical activity among adults aged >=18Years
22: Mammography use among women aged 50–74 Years
23: Mental health not good for >=14 days among adults aged>=18 Years 24: Obesity among adults aged >=18 Years
25: Papanicolaou smear use among adult women aged 21–65 Years
26: Physical health not good for >=14 days among adults aged>=18 Years 27: Sleeping less than 7 hours among adults aged>=18 Years
28: All teeth lost among adults aged >=65 Years
Measure? 28

avg value:avg lower:avg upper:17.96%12.49%24.40%

Continue? (Y/N) n

Expert Answer


Answer to JAVA Someone please help me with this ASAP!!!!!!! There are examples of the files, but if you need them, please let me k…

OR