Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CPT 180 PowerShell assignment CPT 180 PowerShell Assignment 4. Directions Using the following guidelines, create a python program. 1. You will be using the CP180Stuff

CPT 180 PowerShell assignment

image text in transcribedimage text in transcribed

CPT 180 PowerShell Assignment 4. Directions Using the following guidelines, create a python program. 1. You will be using the CP180Stuff folder from the Bash Assignment for this assignment. 2. Create a PowerShell program named work With Files4.ps1 3. Add three comment lines at the top of the program that contain: a. Program Name b. Program Description C. Programmer's Name (You) Write code that will do the following: a. Using an if statement, determine if both the dognames.txt file and the catnames.txt file exist. If both files exist, the program should complete steps b-h below. If either file does not exist, the program should print out the message "Unable to access one or more files". b. Get the contents of the file named dognames.txt in the CPT 180Stuff\pets\dogs folder. C. Print the contents of the file. d. Get the contents of the file named catnames.txt in the CPT180Stuff\pets\cats folder. e. Print the contents of the file. Add two cat names to the catnames.txt file. You can pick the names. The example output below shows the names Sammy and Luna added. g. Get the contents of the file named catnames.txt. h. Print the contents of the file. 5. Submit the work With Files 4.ps1 file into the PowerShell Assignment Submission Folder. f. Hints 1. The PowerShell Add-Content command adds a newline by default. PS E:\TIC_Courses/cpt:180\CPT180 Version 2 Assignments PowerShell> E:\TTC_Courses/cpt 18\CPT180 Version 2)Assignments PowerShell\worlwithFiles 3.051 Spot Nax Lassie Rover Snoopy Misty Felix | Fluffy Kimba Tom Mortime Tigge Sassy Lucy Misty Felix Fluffy Tom Martine Tigger Sassy Lucy Sammy Luna PS E:\TTC_Courses/cpt180 CPT180 Version 2!Assignments PowerShell> | CPT 180 PowerShell Assignment 4. Directions Using the following guidelines, create a python program. 1. You will be using the CP180Stuff folder from the Bash Assignment for this assignment. 2. Create a PowerShell program named work With Files4.ps1 3. Add three comment lines at the top of the program that contain: a. Program Name b. Program Description C. Programmer's Name (You) Write code that will do the following: a. Using an if statement, determine if both the dognames.txt file and the catnames.txt file exist. If both files exist, the program should complete steps b-h below. If either file does not exist, the program should print out the message "Unable to access one or more files". b. Get the contents of the file named dognames.txt in the CPT 180Stuff\pets\dogs folder. C. Print the contents of the file. d. Get the contents of the file named catnames.txt in the CPT180Stuff\pets\cats folder. e. Print the contents of the file. Add two cat names to the catnames.txt file. You can pick the names. The example output below shows the names Sammy and Luna added. g. Get the contents of the file named catnames.txt. h. Print the contents of the file. 5. Submit the work With Files 4.ps1 file into the PowerShell Assignment Submission Folder. f. Hints 1. The PowerShell Add-Content command adds a newline by default. PS E:\TIC_Courses/cpt:180\CPT180 Version 2 Assignments PowerShell> E:\TTC_Courses/cpt 18\CPT180 Version 2)Assignments PowerShell\worlwithFiles 3.051 Spot Nax Lassie Rover Snoopy Misty Felix | Fluffy Kimba Tom Mortime Tigge Sassy Lucy Misty Felix Fluffy Tom Martine Tigger Sassy Lucy Sammy Luna PS E:\TTC_Courses/cpt180 CPT180 Version 2!Assignments PowerShell> |

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

Intelligent Information And Database Systems Asian Conference Aciids 2012 Kaohsiung Taiwan March 2012 Proceedings Part 2 Lnai 7197

Authors: Jeng-Shyang Pan ,Shyi-Ming Chen ,Ngoc-Thanh Nguyen

2012th Edition

3642284892, 978-3642284892

Students also viewed these Databases questions

Question

What may each periodic annuity payment be considered?

Answered: 1 week ago

Question

2. Enrolling employees in courses and programs.

Answered: 1 week ago

Question

1. Communicating courses and programs to employees.

Answered: 1 week ago

Question

6. Testing equipment that will be used in instruction.

Answered: 1 week ago