How do I use the Java String Builder class to create the HTML String that will be
Fantastic news! We've Found the answer you've been seeking!
Question:
How do I use the Java String Builder class to create the HTML String that will be output to the arches.html file? Do I have to update line 31 // TODO - remove the next line and replace it with your code and Create your own methods as needed and line 48 // TODO Your methods go here.
Transcribed Image Text:
Package Explorer X Lab-2 > JRE System Library [JavaSE-11] ✓ src ✓edu.cscc > Lab02.java ✓ module-info.java Lab2Solution arches.html Lab2Data.txt VideoGameCatalog 8 $ ☐ *Lab02.java X module-info.java 1 package edu.cscc; 2 import java.io. BufferedWriter; 3 import java.io.File; 4 import java.io.FileNotFoundException; 5 import java.io.FileWriter; 6 import java.io.IOException; 7 import java.util.Scanner; 8 arches.html 13 14 15 16 17 18 19 20 210 22 23 24 25 9 // Totoy Bibo, 9/10/2022, generating simple web page 10 public public class Labe2 { 11 120 Lab2Data.txt private static String pre = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Natural Arches"+ "</title>\n<meta charset=\"utf-8\">\n</head>\n<body>\n"+ "<h1>Ohio Natural Arches</h1>\n<ul>\n"; private static String post = "</ul>\n</body>\n</html>\n"; private static final char DEGREES = '\uеев0'; private static final String LI_START = "<li>"; private static final String LI_END = "</li>\n"; public static void main(String[] args) { BufferedWriter bw = null; File file = new File("Lab2Data.txt"); try (Scanner input = new Scanner (file); ) { bw = new BufferedWriter (new FileWriter(new File("arches.html"))); bw.write(pre); input.nextLine(); while (input.hasNext()) { Properties Problems Console X Declaration X D Y <terminated > Lab02 [Java Application] C:\Program Files\AdoptOpen JDK\jdk-11.0.9.11-hotspot\bin\javaw.exe (Sep 13, 2022, 10:04:45 PM - 10:04:46 PM) [pid: 16348] HTML file generated! Package Explorer X Lab-2 > JRE System Library [JavaSE-11] ✓ src ✓edu.cscc > Lab02.java ✓ module-info.java Lab2Solution arches.html Lab2Data.txt VideoGameCatalog 8 $ ☐ *Lab02.java X module-info.java 1 package edu.cscc; 2 import java.io. BufferedWriter; 3 import java.io.File; 4 import java.io.FileNotFoundException; 5 import java.io.FileWriter; 6 import java.io.IOException; 7 import java.util.Scanner; 8 arches.html 13 14 15 16 17 18 19 20 210 22 23 24 25 9 // Totoy Bibo, 9/10/2022, generating simple web page 10 public public class Labe2 { 11 120 Lab2Data.txt private static String pre = "<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n<title>Natural Arches"+ "</title>\n<meta charset=\"utf-8\">\n</head>\n<body>\n"+ "<h1>Ohio Natural Arches</h1>\n<ul>\n"; private static String post = "</ul>\n</body>\n</html>\n"; private static final char DEGREES = '\uеев0'; private static final String LI_START = "<li>"; private static final String LI_END = "</li>\n"; public static void main(String[] args) { BufferedWriter bw = null; File file = new File("Lab2Data.txt"); try (Scanner input = new Scanner (file); ) { bw = new BufferedWriter (new FileWriter(new File("arches.html"))); bw.write(pre); input.nextLine(); while (input.hasNext()) { Properties Problems Console X Declaration X D Y <terminated > Lab02 [Java Application] C:\Program Files\AdoptOpen JDK\jdk-11.0.9.11-hotspot\bin\javaw.exe (Sep 13, 2022, 10:04:45 PM - 10:04:46 PM) [pid: 16348] HTML file generated!
Expert Answer:
Answer rating: 100% (QA)
Certainly To use the StringBuilder class to create the HTML String and update the code accordingly y... View the full answer
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date:
Students also viewed these programming questions
-
Complete the welding symbols shown to the right of the desired weld. A 25 25 .50 WELD A TO BE GROUND FLAT .50 B 5.00 4 10.00- .50- GAS METAL ARC WELDING PROCESS TO BE USED 3.00 3.00 3.00 3.00 .38...
-
(10 points) Given that ry + xy = 1. 1. Find a solution of the differential equation that satisfies the initial condition y(1) = 10. Answer: y = 2. Find a solution of the differential equation that...
-
Arbitration, mediation, reference to a third person , an association tribunal, summary jury trial, rent-a-judge, minitrials and judicial triage, are all forms of what is known as?
-
How does the range of hFE (Fig. 3.23j, normalized from hFE = 100) compare with the range of hfe (Fig. 3.23f) for the range of IC from 0.1 to 10 mA?
-
A cell membrane has a surface area of 1.0 107 m2, a dielectric constant of 5.2, and a thickness of 7.5 nm. The membrane acts like the dielectric in a parallel plate capacitor; a layer of positive...
-
1:Describe some of the advantages and disadvantages of having a team in a negotiation. 2: https://www.glassdoor.com/blog/4-ways-win-workplace-negotiations/
-
Whistle-blowers often question themselves as to whether they are doing the right thing. Terms such as snitch and tattletale are often associated with an individual who exposes wrongdoing. Do you...
-
Yu Technology Co. manufactures CDs and DVDs for computer software and entertainment companies. Yu uses job order costing. On April 2, Yu began production of 5,700 DVDs, Job 423, for Portrait Pictures...
-
As you consider the differences between U.S. GAAP and IFRS with respect to property, plant, and equipment, which do you believe is going to be the greatest challenge to converge? Why? What do you...
-
The average cost to produce x CDs can be represented 1700 by A(x) = X 1200. Find the limit as x approaches positive infinity
-
Loose coupling means that the classes are mostly independent. If the only knowledge that class A has about B, is what class B has exposed through its interface than that is considered loosely...
-
Baldwin Corporation produces three separate products from a common process with a joint cost of $120,000. Each of the products can be sold at the split-off point or can be processed further and then...
-
Onslow Company purchased a used machine for $240,000 cash on January 2 On January 3, Onslow paid $10,000 to wire electricity to the machine. Onslow paid an additional $2,000 on January 4 to secure...
-
Specify three areas of growth related to leadership development as a school counselor. Locate professional development resources to assist you in the development of each leadership trait. Construct a...
-
A company uses a job cost system. As of January 1, its records showed the following balances: Materials Work in Process Finished Goods (Job No. 211) 13,500 25,800 30,000 The work in process inventroy...
-
Tourism industry of Indonesia PESTLE Analysis, SWOT and Ease of doing business in Indonesia?
-
How can you tell from the vertex form y = a(x - h) 2 + k whether a quadratic function has no real zeros?
-
Bev and Ken Hair have been married for 3 years. They live at 3567 River Street, Springfield, MO 63126. Ken is a full-time student at Southwest Missouri State University (SMSU) and Bev works as an...
-
Harold Conners (Social Security number 785-23-9873) lives at 13234 DeMilo Drive, Houston, TX 77052, and is self-employed for 2012. He estimates his required annual estimated tax payment for 2012 to...
-
Abigail (Abby) Boxer is a single mother working as a civilian accountant for the U.S. Army. Her Social Security number is 676-73-3311 and she lives at 3456 Alamo Way, San Antonio, TX 78249. Helen,...
-
Many retailers have installed point-of-sale (POS) systems to better manage their inventory and to save time and cut costs associated with ringing up customer sales. How should employees be trained to...
-
Airlines have long used database technology to monitor capacity and maximize revenue by charging different prices to almost every passenger on a given flight. To what extent can other industries...
-
Why not use copies of the sales order as the picking ticket, packing list, and sales invoice?
Study smarter with the SolutionInn App