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

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

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

Expert Solution
steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY