JAVA
Module 04 Debugging Assignment
In this assignment you will demonstrate your knowledge ofdebugging by fixing the errors you find in the program below. Fixthe code, and paste it in this document, along with the list of theproblems you fixed.
This example is based on a program which counts the words in theGettysburg Address.
import java.util.Scanner;
public class Gettysburg {
public String void main(String[] args) {
String URLString =”http://cs.armstrong.edu/liang/Lincoln.txt’;
try {
java.net.URL url = newjava.net.URL(URLString)
int count = 0;
try (Scanner input = newScanner(url.openStream()))
while (input.hasNext()){
String Word= input.next();
if(word.trimm().lemgth() > 0)
count += 1;
}
}
}
System.out.println(“The number ofwords is ” + count);
}
catch (java.net.MalformedUNLException
PayPal Gateway not configured
PayPal Gateway not configured