Page 1 of 1

 Create a menu that will allow you 5 selections for items and one to exit.  Inside the menu you need to read user inpu

Posted: Sun May 15, 2022 12:53 pm
by answerhappygod
 Create a menu that will allow you 5 selections
for items and one to exit.
 Inside the menu you need to read user input to
decide which of the 5 selections
 After a menu item is executed, the screen
should be repainted with the menu until the user
specifies that they want to finish.
 You need to somehow handle incorrect user
input, but only exit if they choose your exit option
 For this part, you only need to print a message
for each of the 5 selections. Next week you will
add functions for each selection.Sample Menu
Menu
1. Selection 1
2. Selection 2
3. Selection 3
4. Selection 4
5. Selection 5
Enter Your Selection ( x to Exit) ==>Menu Item
Functionality
 You need to bring the system down for maintenance and call the
users to let
them know. This selection finds out who is logged in, pulls the
first name
and the telephone number out of the addressfile and displays it to
the
standard output.
 The user stu23 has gone home for the day and left his processes
running.
You want to find those processes and stop them. You want to use
this
option in the future so it will prompt for the user name, find and
stop all
processes started by that user (include an “are you sure”
message).
 It is discovered that two users have the same user id in the
address file.
This option checks the addressfile for that situation and, if it
exists, prompts
you for a new userid which it will fix in the file with.
 Your Boss has asked for a list of all users, but does not care
about the
userid. This option will pull out all users and sort them by last
name but the
output should be : Firstname Lastname Address Town Telephone
number
 The users are storing way too many files in their home directory
and you
would like to notify the top 5 offenders. You might want to run
this script
again for more or less users so this selection will prompt for the
number of
users to identify, check how many files they have in their home
directory
and send a list of those users to the standard output.
File below
stu1:Tom Arnold:1234 Apple St:Toms River:NJ:732 555-9876
stu2:Jack Black:2345 Baker St:Jackson:NJ:732 555-8765
stu3::Tom Cruise:3456 Charlie St:Manchester:NJ:732 555-7654
stu4:John Depp:4567 Delta St:Toms River:NJ:732 555-6543
stu5:Dan Elfman:5678 Zebra St:Point Pleasant:NJ:732 555-5432
stu6:Henry Ford:6789 Xray St:Jackson:NJ:732 555-4321
stu7:John Glenn:9876 Cherry St:Bayville:NJ:732 555-1234
stu8:Jimi Hendrix:8765 Rutgers St:Manchester:NJ:732 555-2345
stu9:Marty Ichabod:7654 Hollow St:Wall:NJ:732 555-3456
stu10:Mike Jackson:6543 Thriller St:Toms River:NJ:732
555-4567
stu11:Ashton Kutcher:5432 Demi St:Jackson:NJ:732 555-5678
stu12:Jude Law:4321 Watson St:Point Pleasant:NJ:732 555-6789
stu13:Nelson Mandela:2468 Apartheid St:Toms River:NJ:732
555-8321
stu14:Jim Neutron:468 Electron St:Beachwood:NJ:732 555-5285
stu15:Rory Oscar:135 Academy St:Berkeley:NJ:732 555-7350
stu15:Brad Pitt:579 Jolie St:Manahawkin:NJ:732 555-8258
stu17:Don Quaker:862 Oatmeal Dr:Wall:NJ:732 555-4395
stu18:Tony Romo:321 Simpson St:Beachwood:NJ:732 555-9596
stu19:Will Smith:8439 Robot St:Manahawkin:NJ:732 555-2689
stu20:Tim Burton:539 Skellington St:Toms River:NJ:732
555-9264
stu23:Mel Gibson:274 Raging St:Bayville:NJ:732 555-1234