Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question about exception >C file://users/stone/Downloads/Lab10%20(1).pdf ENGR 131 In-Lab Assignment 0: Programming Languages 2/2 departmentcode.substring (0, 4); number -Integer.parselnt (code.substring (4, 7)); System.out.println(Department: +department) System.out.println(Number: umber)
Question about exception
>C file://users/stone/Downloads/Lab10%20(1).pdf ENGR 131 In-Lab Assignment 0: Programming Languages 2/2 departmentcode.substring (0, 4); number -Integer.parselnt (code.substring (4, 7)); System.out.println("Department: "+department) System.out.println("Number: "umber) Part B (programming, 90 points): Submit java files (but not class files!) on Canvas. You may discuss questions with other students, but file sharing is prohibited. See posted information about the due date and any . Include a comment containing your name at the top of each program. . Upload a single, compressed file (e.g. zip) to Canvas that contains all required files (java). .Grading w include programming style requirements (see Style Guide posted on the Syllabus page) . All work should be your own, as explained in the Academic Integrity policy from the syllabus. File sharing is prohibited. NOTE: There is only one problem. Write an application class that asks the user for a filename and prints a message containing the name in a file with that same filename. If the file cannot be opened, the program should print the message "ERROR: Can't open file." Use PrintWriter to open the file and try catch to prevent Java's default IOException message. Below are two separate cxamples (user input in bold). Example # l in which the file is successfully opened: Console/screen. Enter a file name: test. txt File contents Hello from test.txt! Example #2 in which the file is not successfully opened (no file is created Enter a file name: /.txt ERROR: Can't open fileStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started