A text file is already created called devices.txt contains a list of devices called device 1, device 2, and device 3 In the main function, create a main menu for the end user to select from different options: OUTPUT EXAMPLE Welcome to the Device Management System 1.    view all devices 2.    add a device 3.    delete a device 4.    update a device 5.    exit the program Select one option from the list ( 1, 2, 3,4 or 5 ): 2 Add the device: device 4 device 4 is added Do you want to continue?(y/n):y [the devices.txt should be updated as well] device.txt device 1 device 2 device 3 device 4    ____________________________________________________________________________________- if option 1 is selected it should output the contents of of device.txt if option 2 is selcted it should add a device to device.txt if option 3 is selcted it should remove a device from device.txt if option 4 is selcted the update function updates the name of a device when the user enters the device code. then the updated list of devices is written back to the file. if option 5 is selected, the program should stop running.  If an invalid option is inputed, the program will output "error"  The program should continue until the user input is 5 from the menu to exit the program or 'n' when asked if they want to continue. ALL OPTIONS MUST BE CODED IN THEIR OWN FUNCTION  TO BE CALLED LATER IN MAIN

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

PYTHON PLEASE

A text file is already created called devices.txt contains a list of devices called device 1, device 2, and device 3

In the main function, create a main menu for the end user to select from different options:

OUTPUT EXAMPLE

Welcome to the Device Management System


1.    view all devices
2.    add a device
3.    delete a device
4.    update a device
5.    exit the program

Select one option from the list ( 1, 2, 3,4 or 5 ): 2

Add the device: device 4
device 4 is added

Do you want to continue?(y/n):y

[the devices.txt should be updated as well]

device.txt

device 1

device 2

device 3

device 4 

 

____________________________________________________________________________________-

if option 1 is selected it should output the contents of of device.txt

if option 2 is selcted it should add a device to device.txt

if option 3 is selcted it should remove a device from device.txt

if option 4 is selcted the update function updates the name of a device when the user enters the device code. then the updated list of devices is written back to the file.

if option 5 is selected, the program should stop running. 

If an invalid option is inputed, the program will output "error" 

The program should continue until the user input is 5 from the menu to exit the program or 'n' when asked if they want to continue.

ALL OPTIONS MUST BE CODED IN THEIR OWN FUNCTION  TO BE CALLED LATER IN MAIN

Expert Solution
steps

Step by step

Solved in 2 steps with 4 images

Blurred answer
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