Task 1 Create a method that Asks the user for how many parent directory levels to go up by Only accept a range of 1 to 3 Throw an exception if not within range Throw an exception if not a valid input (not a number) Ask the user whether they want to view all files or directories Throw an exception if they do not choose one of those options. You can use a number, a character, the whole words or a combination of the three as acceptable values. Output the full path of each directory or file on a new line. Task 2 Create a method that Creates a directory that stores texts files representing user profiles in your project solution Ask a user for their studentNumber. Search your project for a directory created in the first step for a file named studentNumber.txt If it exists Welcome the user with a greeting such as "Hello firstName lastName" If it does not exist Ask the user for their firstName and lastName Save this information in a file named studentNumber.txt Format the saved information in any fashion you desire, but you need to be able to retrieve the firstName and lastName later Task 3 Create a method that: Creates a file with 5 lines. Each line is to have a minimum of 30 characters. Overwrite the file each time this function it is run Ask the user how many characters he or she would like to skip Skip that many characters. Output the rest of the file contents Task 4 Create a method that: Creates a file with 5 lines. Each line is to have a minimum of 30 characters. Overwrite the file each time this function it is run Ask the user with line number they would like to read Output the contents of that line numbe
Task 1 Create a method that
Asks the user for how many parent directory levels to go up by
Only accept a range of 1 to 3
Throw an exception if not within range
Throw an exception if not a valid input (not a number) Ask the user whether they want to view all files or directories
Throw an exception if they do not choose one of those options.
You can use a number, a character, the whole words or a combination of the
three as acceptable values.
Output the full path of each directory or file on a new line.
Task 2
Create a method that Creates a directory that stores texts files representing user profiles in your project solution
Ask a user for their studentNumber.
Search your project for a directory created in the first step for a file named studentNumber.txt
If it exists
Welcome the user with a greeting such as "Hello firstName lastName"
If it does not exist
Ask the user for their firstName and lastName
Save this information in a file named studentNumber.txt
Format the saved information in any fashion you desire,
but you need to be able to retrieve the firstName and lastName later
Task 3 Create a method that:
Creates a file with 5 lines. Each line is to have a minimum of 30 characters.
Overwrite the file each time this function it is run
Ask the user how many characters he or she would like to skip
Skip that many characters.
Output the rest of the file contents
Task 4 Create a method that:
Creates a file with 5 lines. Each line is to have a minimum of 30 characters.
Overwrite the file each time this function it is run Ask the user with line number they would like to read
Output the contents of that line number

Step by step
Solved in 4 steps with 2 images









