Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program that will check Java file for syntax errors. The program will ask for an input-file name and output-file name and will then

Write a program that will check Java file for syntax errors.

The program will ask for an input-file name and output-file name and will then copy all the code from the Java input-file to the Jave output file, but with following changes:

Any syntax error found in the Java input file will be corrected:

Missing semicolon

Missing compound statements (Curly braces)

All the comments have to start with // and end with a period Four spaces should be used as the unit of indention.

Tabs must be set exactly every 8 spaces (not 4)

Your program should have a simple GUI ((You don't have to worry about the GUI i can do this myself)).

Use ArrayList or LinkedList class to solve the problem.

Thoroughly test your code for any possible input. Do not hardwire the output.

Initial example Input file: JavaInput.java

//Program to calculate sum of two numbers.

public class TestProgram{

public static void main(String[]args)

{int n1,n2; n1=5; n2=10

int answer=0; answer=n1+n2;

System.out.println(answer);}}

What the Example Output file should look like: JavaOutput.java

//Program to calculate sum of two numbers.

public class TestProgram

{

public static void main(String[]args)

{

int n1,n2;

n1=5;

n2=10;

int answer=0;

answer=n1+n2;

System.out.println(answer);

}

}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Management Databases And Organizations

Authors: Richard T. Watson

3rd Edition

0471418455, 978-0471418450

More Books

Students also viewed these Databases questions

Question

What is the basis for Security Concerns in Cloud Computing?

Answered: 1 week ago

Question

Describe the three main Cloud Computing Environments.

Answered: 1 week ago