Question: My professor asked me to write a java program that will pull comments from another java file and display in a .txt file. I wrote

My professor asked me to write a java program that will pull comments from another java file and display in a .txt file. I wrote the program and tested to make sure it works but he still gave me a 0 for my score. The reason for this is he said there is a required main class: CScrape. I am confused and am not sure what he means by that. Ill attach a picture of my program.
 My professor asked me to write a java program that will

pse Project Run Window Help 2e import java.io.File:D public class Cscrape ( Pls pihlie statie vota maincstringtr Scanner keyboard new Scanner(System.in) int lineNumber 1; System.out.println("Enter input file:) String inFile keyboard.nextline) try f File reader = new File(inFile); Scanner in new Scanner(reader); inFile inFile.replace(.java, .txt) Printhriter txtFile - new Printriter(infile); System.out.println("InThe txt file nane is: in txtFile.println("Comment Scrape R. Michael) uhle(in.hasNextLine()) { String line in.nextline() lineNumber++; if (line.contains("I txtFile.println(linekumber+ line.substring if (line.contains()) txtFile.print1n(lineNumber + line. substring while(! line.contains(")) line in.nextline): pse Project Run Window Help 2e import java.io.File:D public class Cscrape ( Pls pihlie statie vota maincstringtr Scanner keyboard new Scanner(System.in) int lineNumber 1; System.out.println("Enter input file:) String inFile keyboard.nextline) try f File reader = new File(inFile); Scanner in new Scanner(reader); inFile inFile.replace(.java, .txt) Printhriter txtFile - new Printriter(infile); System.out.println("InThe txt file nane is: in txtFile.println("Comment Scrape R. Michael) uhle(in.hasNextLine()) { String line in.nextline() lineNumber++; if (line.contains("I txtFile.println(linekumber+ line.substring if (line.contains()) txtFile.print1n(lineNumber + line. substring while(! line.contains(")) line in.nextline)

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!