So I wrote this program in method form, except i\'m not sure how to call it. It\
ID: 3836528 • Letter: S
Question
So I wrote this program in method form, except i'm not sure how to call it. It's a file scanning program that contains a .txt file that has a few lines of string. Plese help
4 public class stri public static void mainCString args) 63 throws Fil eNotFoundException 10 11 stripCommentsOnew FileC"HW4Q4P1.txt")); 14 15 16 17 public static void stripCommentsCScanner read-input 188 19 20 21 String read line 22 m 23 while Cread input has NextLi 24 ne 25 26 27 read line read input nextLi 28 ne 29 if(read line contains C" read line 30 contains 31 32 33 System. out.printlnC); 34 35 36 37 38 else ifC read line contains C'*/") 39 else if Cread-line contains 45 int idx read-line .i System. out. printlnC read line subs tri ngCO idx)) 50 51 52 53 else 54 55 56 57 Svetem nut nrintin(rend lineExplanation / Answer
Answer:
You have to call like
stripComments(new Scanner(new File("HW4Q4P1.txt")));
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.