Lab 2-Simple Web Page Generation Background A natural arch is a rock formation with an opening...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Lab 2-Simple Web Page Generation Background A natural arch is a rock formation with an opening underneath it. There are a variety of natural arches that can be visited in the state of Ohio. The Ohio Department of Natural Resources has produced a document entitled: "Ohio's Natural Arches" that discusses them and provides their locations. Your assignment will be to complete a program that reads in a file containing information about Ohio natural arches, processes the data, and generates a web page about Ohio natural arches. Assignment Keyhole Arch at Fort Hill You'll start by downloading a zip file named "Lab2Starter.zip" from Blackboard. Unzip the file with 7-zip using "Extract Here". Then import the project into Eclipse. The project contains some starter code. Execute the starter code. The code will read in the data file and generate a web page named arches.html containing a list of the raw data lines. Open the arches.html file, by selecting it in the left project window (left-click on the file) and then invoke a context menu (right-click) on the file and select "Open with" and "Text Editor". View the output file. Again, select the file and invoke the context menu. This time select "Open with" and "Web Browser". View the same file in the web browser. You will implement code that will generate a better web page - that includes a link to a Google map showing the location of each arch. The project folder contains a data file named "Lab2Data.txt". The first line of the file contains heading information. Your program should skip this line. Subsequent lines contain information about an arch - one arch per line. Each line contains a set of comma-separated values describing the arch. The fields are: 1. Name name of the arch 2. County the county where the arch is located - 3. Park the name of the park containing the arch 4. Geocoordinate - latitude and longitude of the arch The latitude and longitude geocoordinates look like this: 39° 6' 34.80" N 83° 24' 49.56" W and consist of: 1. Degrees of latitude 2. Minutes of latitude 3. Seconds of latitude (to two decimal places) 4. "N" or "S" for North or South latitude (hemisphere of the earth) 5. Degrees of longitude 6. Minutes of longitude 7. Seconds of longitude 8. "E" or "W" for East or West of the Prime Meridian (zero degrees longitude which passes through Greenwich, England). ° Each field of the geocoordinates is separated from the next by a space. Note that the degree symbol is represented in Java (Unicode) by '\u00B0'. You will need to split the comma-separated-values into different String fields. You must convert the geocoordinates into decimal degrees, such as: 39.1097,-83.4138 , (which is the correct conversion for the above geocoordinates to four decimal places). The formula for conversion is: Latitude Decimal degrees = degrees + (minutes / 60) + (seconds / 3600) Note: If the latitude is 'S' (South) make the decimal degree value negative. Longitude Decimal degrees = degrees + (minutes / 60) + (seconds / 3600) Note: If the longitude is 'W' (West) make the decimal degree value negative. Study the existing program code that already generates a web page. It reads in each line from the data file and generates an HTML list item containing the raw data. You will modify the code that generates each list item so that instead, it generates the following list item: <li><a href="linkURL">name</a> at coordinates (declat, decLong) is located at park in county County</li> Where linkURL is: https://www.google.com/maps/search/?api=1&query=decLat,decLong name, park, and county are obtained from the data file. declat and decLong are decimal degrees latitude and longitude that you have calculated. Thus, the line of data: The Keyhole, Highland, Fort Hill, 39° 6' 34.80" N 83° 24' 49.56" W would be converted to the following line of HTML by your code: <li><a href="https://www.google.com/maps/search/?api=1&query=39.1097,-83.4138">The Keyhole</a> at coordinates (39.1097,-83.4138) is located at Fort Hill in Highland County</li> Note: in your program as you build the line of HTML from each line of input you must use the Java StringBuilder class (not String concatenation) to create the HTML String that will be output to the arches.html file. Sample Output Once completed, your web page should like the following page. When you click on a link, it should take you to the Google map page for the arch (as shown in the inset). Natural Arches ✗ + ← file:///D:/JAVAIl/Lab-2/arches.html citWebDev | Connect t... Microsoft Office Home fw Find Scholarships for ... JavaScript Variables jQuery G Head First JavaScript -... P HTMI Ohio Natural Arches The Keyhole at coordinates (39.1097,-83.4138) is located at Fort Hill in Highland County • Rockbridge at coordinates (39.5766,-82.5019) is located at Rockbridge Preserve in Hocking County Rockhouse at coordinates (39.4978,-82.6140) is located at Hocking Hills State Park in Hocking County Trimmer Arch at coordinates (39.2947,-83.3729) is located at Paint Creek Wildlife Area in Ross County Arch Rock at coordinates (39.1906,-82.3716) is located at Vinton Furnace State Forest in Vinton County Greenville Falls Arch at coordinates (40.1095,-84.3760) is located at Greenville Falls Scenic River Area in Miami County Problems Javadoc Declaration Console <terminated> Lab02 [Java Application] C:\Program Files\AdoptOpenJDK\jdk-11 HTML file generated! Web Browser https://www.google.com/maps/search/?api=1&query=39.1097,-83.4138 39.1097,-83.4138 39°06'34.9"N 83°24'49.7"W 39.109700, -83.413800 ax Restaurants Hotels Sign in Baker Fork 口 V Directions Save Nearby Send to your phone Share Layers Google Map data ©2021 United States Terms Privacy Send feedback 50 ft L Lab 2-Simple Web Page Generation Background A natural arch is a rock formation with an opening underneath it. There are a variety of natural arches that can be visited in the state of Ohio. The Ohio Department of Natural Resources has produced a document entitled: "Ohio's Natural Arches" that discusses them and provides their locations. Your assignment will be to complete a program that reads in a file containing information about Ohio natural arches, processes the data, and generates a web page about Ohio natural arches. Assignment Keyhole Arch at Fort Hill You'll start by downloading a zip file named "Lab2Starter.zip" from Blackboard. Unzip the file with 7-zip using "Extract Here". Then import the project into Eclipse. The project contains some starter code. Execute the starter code. The code will read in the data file and generate a web page named arches.html containing a list of the raw data lines. Open the arches.html file, by selecting it in the left project window (left-click on the file) and then invoke a context menu (right-click) on the file and select "Open with" and "Text Editor". View the output file. Again, select the file and invoke the context menu. This time select "Open with" and "Web Browser". View the same file in the web browser. You will implement code that will generate a better web page - that includes a link to a Google map showing the location of each arch. The project folder contains a data file named "Lab2Data.txt". The first line of the file contains heading information. Your program should skip this line. Subsequent lines contain information about an arch - one arch per line. Each line contains a set of comma-separated values describing the arch. The fields are: 1. Name name of the arch 2. County the county where the arch is located - 3. Park the name of the park containing the arch 4. Geocoordinate - latitude and longitude of the arch The latitude and longitude geocoordinates look like this: 39° 6' 34.80" N 83° 24' 49.56" W and consist of: 1. Degrees of latitude 2. Minutes of latitude 3. Seconds of latitude (to two decimal places) 4. "N" or "S" for North or South latitude (hemisphere of the earth) 5. Degrees of longitude 6. Minutes of longitude 7. Seconds of longitude 8. "E" or "W" for East or West of the Prime Meridian (zero degrees longitude which passes through Greenwich, England). ° Each field of the geocoordinates is separated from the next by a space. Note that the degree symbol is represented in Java (Unicode) by '\u00B0'. You will need to split the comma-separated-values into different String fields. You must convert the geocoordinates into decimal degrees, such as: 39.1097,-83.4138 , (which is the correct conversion for the above geocoordinates to four decimal places). The formula for conversion is: Latitude Decimal degrees = degrees + (minutes / 60) + (seconds / 3600) Note: If the latitude is 'S' (South) make the decimal degree value negative. Longitude Decimal degrees = degrees + (minutes / 60) + (seconds / 3600) Note: If the longitude is 'W' (West) make the decimal degree value negative. Study the existing program code that already generates a web page. It reads in each line from the data file and generates an HTML list item containing the raw data. You will modify the code that generates each list item so that instead, it generates the following list item: <li><a href="linkURL">name</a> at coordinates (declat, decLong) is located at park in county County</li> Where linkURL is: https://www.google.com/maps/search/?api=1&query=decLat,decLong name, park, and county are obtained from the data file. declat and decLong are decimal degrees latitude and longitude that you have calculated. Thus, the line of data: The Keyhole, Highland, Fort Hill, 39° 6' 34.80" N 83° 24' 49.56" W would be converted to the following line of HTML by your code: <li><a href="https://www.google.com/maps/search/?api=1&query=39.1097,-83.4138">The Keyhole</a> at coordinates (39.1097,-83.4138) is located at Fort Hill in Highland County</li> Note: in your program as you build the line of HTML from each line of input you must use the Java StringBuilder class (not String concatenation) to create the HTML String that will be output to the arches.html file. Sample Output Once completed, your web page should like the following page. When you click on a link, it should take you to the Google map page for the arch (as shown in the inset). Natural Arches ✗ + ← file:///D:/JAVAIl/Lab-2/arches.html citWebDev | Connect t... Microsoft Office Home fw Find Scholarships for ... JavaScript Variables jQuery G Head First JavaScript -... P HTMI Ohio Natural Arches The Keyhole at coordinates (39.1097,-83.4138) is located at Fort Hill in Highland County • Rockbridge at coordinates (39.5766,-82.5019) is located at Rockbridge Preserve in Hocking County Rockhouse at coordinates (39.4978,-82.6140) is located at Hocking Hills State Park in Hocking County Trimmer Arch at coordinates (39.2947,-83.3729) is located at Paint Creek Wildlife Area in Ross County Arch Rock at coordinates (39.1906,-82.3716) is located at Vinton Furnace State Forest in Vinton County Greenville Falls Arch at coordinates (40.1095,-84.3760) is located at Greenville Falls Scenic River Area in Miami County Problems Javadoc Declaration Console <terminated> Lab02 [Java Application] C:\Program Files\AdoptOpenJDK\jdk-11 HTML file generated! Web Browser https://www.google.com/maps/search/?api=1&query=39.1097,-83.4138 39.1097,-83.4138 39°06'34.9"N 83°24'49.7"W 39.109700, -83.413800 ax Restaurants Hotels Sign in Baker Fork 口 V Directions Save Nearby Send to your phone Share Layers Google Map data ©2021 United States Terms Privacy Send feedback 50 ft L
Expert Answer:
Answer rating: 100% (QA)
Detailed Explanation Based on the lab assignment details provided in the question the task is to create a Java program that reads a data file containi... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Let A, B be sets. Define: (a) the Cartesian product (A B) (b) the set of relations R between A and B (c) the identity relation A on the set A [3 marks] Suppose S, T are relations between A and B, and...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
What tensions may arise if a shareholder-centric model is imposed on a stakeholder-focused society?
-
Regarding a sample proportion: a. What is it? b. What symbol is used for it?
-
The infinite set of real numbers R is not denumerable (that is, N O < IRI). it suffices to show that the open interval (0,1) You may assume each real number can be written as an infinite decimal. If...
-
In September 2013, Ugo Mattera entered into a written construction contract with Baja Properties, LLC. Stephen Chad Golden, the sole owner of Baja Properties, signed the contract and addendums on...
-
Using the network above and the additional information below, find: (a) The crash cost per day (b) Which activities should be crashed to meet a project deadline of 13 days at minimum cost. Assume...
-
MaxBiotech Inc., a Japanese pharmaceutical manufacturer, has agreed to pay JPY 35.5 billion to Pfizer for the right to use its patent on the coronavirus vaccines. This payment is classified as a...
-
On October 1, 20Y8, Jacinto Suarez and Tricia Fritz form a partnership. Suarez agrees to invest $25,000 in cash and inventory valued at $60,000. Fritz invests certain business assets at valuations...
-
Review each situation and list how much income should be reported by the taxpayer in 2021 under the cash method and the accrual method. Situation (receipt occurs in 2021) $184,000 cash from rents, of...
-
Within your Records Management textbook, complete Application 11-1 - Create Logical folder structure, pgs. 306-307. The data files for this Application can be found under Files, LP3 folder,...
-
Since there is no MSFT bond that matures in 2030, we compute the average of the yields of the MSFT4211185 bond that matures in 2025 and MSFT4211189 bond that matures in 2035 assuming this average to...
-
1. In job order cost accounting, the three elements of manufacturing cost are charged directly to job orders. Why is it not necessary to charge manufacturing costs in process cost accounting to job...
-
What is the value of the discriminant of f ? f(x)=3x^(2)+24x+48 How many distinct real number zeros does f have? Show Calculator Stuck? Review related article (s)/(v)ideos or use a hint.
-
You are to use the Hill's Strategy Development Framework. After your cover page, I want the framework to be the first page of your submission. Here is what the framework template should look like:...
-
*:Conducting zone are all except larynx trachea nose O alveoli O O O
-
For each of the following transactions, indicate whether it increases, decreases, or has no effect on the following financial ratios: current ratio, debt-to-equity ratio, profit margin ratio, and...
-
Assume the United States exports 1,000 computers at a price of $3,000 each and imports 150 UK autos at a price of 10,000 each. Assume that the dollar/pound exchange rate is $2 per pound. a....
-
In 2015, bank regulators determined that five banks were guilty of rigging the foreign exchange market. These banks included Barclays PLC, Citigroup Inc., JPMorgan Chase & Co., Royal Bank of Scotland...
-
Economists at the Federal Reserve Bank of Dallas have examined the effects of changing competitiveness and deindustrialization on the labor market. They conclude that the decline of industrial...
-
On which areas do governing boards focus?
-
What are the six principles of good governance?
-
Why is diversity important in the composition of a governing board?
Study smarter with the SolutionInn App