Answered step by step
Verified Expert Solution
Link Copied!

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)

image text in transcribed

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 file

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

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

More Books

Students also viewed these Databases questions

Question

b. What are its goals and objectives?

Answered: 1 week ago

Question

Why is the System Build Process an iterative process?

Answered: 1 week ago