Question: Assignment 1 Create a Java class named Assignment1 (1 mark deduction if not). The package name should be assignment1. *Please note the case sensitivity. The

Assignment 1 Create a Java class named Assignment1 (1 mark deduction if not). The package name should be assignment1. *Please note the case sensitivity. The class name should start with an uppercase A and the package name should start with a lowercase a. It is to have a main method that calls each of the static methods below (2 marks deducted if not) Task 1: 6 marks Create a static method named task1 1) Ask the user for a file name (You will automatically add the txt extension to the file name) (1 mark) 2) Ask the user for text content to add to the file. (1 mark) 3) Write or append to the file in Step 1) the text content in Step2) (4 marks) Task 2: 14 marks Create a static method named task2 1) Ask the user for a relative path value. (1 mark) 2) Determine if the relative path exists (3 marks) a) If not found: i) output to Standard Error an appropriate message and end the program (1 mark) b) If found: i) Output the count of all files and folders found. This count should include subdirectories. Output a total count, a file count and a directory count. (9 marks) Please scroll to next page to see an example Example: If the current working directory structure is: out (empty) src comp1008 wk1 (empty) wk2 Week2a.java Week2b.java wk3 (empty) comp1011 wk1 Box.java BoxRunner.java wk2 Shoe.java ShoeRunner.java properties.cnf And User input: ./ (The current working directory) Program Output: There are 16 total files and directories; 7 files & 9 directories. Marking Please submit one .java source files

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!