关键词 > CSC142

Programming Assignment CSC142

发布时间:2024-06-12

Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Programming Assignment CSC142

I have a Geiger Counter (https://en.wikipedia.org/wiki/Geiger_counter) that measures beta, gamma, and X-ray radiation in counts per minute.

 

The Geiger counter cannot distinguish between those types of radiation, and does not measure from which direction the radiation originated.

I don ’t have any strong radioactive sources in my home that I know of, so I assume the Geiger counter is measuring only the natural background radiation in the local environment of the counter.

(https://en.wikipedia.org/wiki/Background_radiation)

Some of the background radiation measured comes from the decay of

radioactive isotopes in the earth.  Another component of the background radiation comes from cosmic rays, originating in outer space.

Average background radiation counts per minute varies somewhat by

geographic location.  If you are near a deposit of radioactive material in the earth, you can expect the number of counts per minute to be relatively

higher. (you can find a map of average counts per minute by geographic location on the internet if you are interested)

Also, the earth ’s atmosphere helps shield us from the cosmic ray

component of the background.  The Wikipedia article above notes that the city of Denver, Colorado (5200 feet elevation) receives approximately twice the amount of radiation from cosmic rays as a city at sea level.

The raw data file logged by the counter was originally formatted as a  .csv file produced by Microsoft Excel.

( https://en.wikipedia.org/wiki/Comma-separated_values)

(I had to rename the file to the extension .txt to get around some

Microsoft-created problems.  The file content is unchanged, only the file extension has been changed from .csv to .txt.

The file looks like the following when displayed using the vi text editor.

Other text editors may show dozens of commas after the data on each line. (it may display quite differently in other text editors or in Excel):

GQ Electronics LLC, GMC Data Viewer,Version 2.40

Date

Time,uSv/h,CPM,#1,#2,#3,#4,#5,#6,#7,#8,#9,#10,#11,#12,#13,#14,#15,#16,#17,#18,#19,#20,#21,#22,#2 3,#24,#25,#26,#27,#28,#29,#30,#31,#32,#33,#34,#35,#36,#37,#38,#39,#40,#41,#42,#43,#44,#45,#  46,#47,#48,#49,#50,#51,#52,#53,#54,#55,#56,#57,#58,#59,#60,

FEDERAL-WAY,,,

2018-04-06 17:13,Every Minute,16, 2018-04-06 17:14,Every Minute,18, 2018-04-06 17:15,Every Minute,15, 2018-04-06 17:16,Every Minute,15,

There is an option on the Geiger counter to log location data – those are the lines in the file that contain the string “ Federal-Way” .

After I inspected the log file, I found that every time the location was

written to the log file, the Geiger counter skipped logging one or two

minutes of data.  I   turned off the location logging around the end of April 2018 in the file, and never turned it back on.


For this project, you are only interested in lines that look like the last few  above:  The time and date the data was taken, and the number of counts per minute (the integer in the 3rd  field of each line of the csv file.)

Your program will read a file with the above format named ‘7_14_2019.txt ’. A link to this file is located under the Resources block in WAMAP.

The file consists of over a year of background radiation measurements,   one measurement per minute.  The first data line in the file shows that at time 17:13 on April 6th, 2018, 16 radiation events were counted.

For this programming project:

1.) Use the RadiationSample class that I have provided in the

Resources Block in WAMAP.  You can create a project for this class in Eclipse, and make the RadiationSample project available to your   project, or you can import the RadiationSample.java file directly into your project.

2.) Find the maximum number of counts per minute in the file and  write all of the data lines to the console that are within 5 counts of the maximum number of counts per minute.  (for example, if you find that the maximum number of counts per minute is 50, write out every line that has 45 counts or greater.)

Write the date/time and counts per minute to the console for those data lines in the format:


         Date                    Counts per minute

2018-04-06 17:13                       35

2018-05-13 06:13                       33

         .                                        .



3.) Examine your output from part 2, and answer this question:

I took the Geiger counter with me on one or two camping trips, and stayed for at least one full day at an elevation of 4900 feet.  My

house where the Geiger counter spends most of its time logging

data is 500 feet above sea level, so we would expect a greater value for the counts per minute, on average, at the higher altitude.

What is the date that I was most likely to be on that camping trip?

Explain what you tried and how you figured this out at the bottom of your header comment block.