Question: Modify the following given Java program. You are expected to modify the supplied Exercise1.java to print just the last lines of each paragraph in HTML

Modify the following given Java program. You are expected to modify the supplied Exercise1.java to print just the last lines of each paragraph in HTML format. Copy and paste the Sample input on the console then print the Expected output.

import java.util.Scanner;

public class Exercise1 { /** A simple static string for HTML & table header. */ private static final String HTMLHeader = " " + " " + " " + " CSE: Exercise 1 " + " " + " " + "

"; /** A simple static string to print HMTL footer. */ private static final String HTMLFooter = "
" + " " + "

public static void main(String[] args) { System.out.println(HTMLHeader); Scanner keyboard = new Scanner(System.in);

while (keyboard.hasNextLine()) { String line = keyboard.nextLine(); System.out.println(" " + line + ""); } System.out.println(HTMLFooter); } }

Sample input:

para #1

welcome.

para #2: Introduction

This is a simple test line

to create a 2 line para

conclusion of inputs

This para is the last para.

It has 3 lines

3 lines including this one and 3 blank lines at end

Last paragraph with 1 line

Expected output:

CSE: Exercise 1

welcome.
to create a 2 line para
3 lines including this one and 3 blank lines at end
Last paragraph with 1 line

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!