Write a program to manage a user list that can be modified

Assignment Help Programming Languages
Reference no: EM131210656

Integrative Programming

Assignment- Managing a User Account List

Objective:

To manage a user list that can be modified and saved to a text file.

Inputs:

• Input text file consisting of pairs of usernames and passwords, separated by a colon (:) without any spaces

• User choice: (‘a'-add user account, ‘m'-modify existing user account, ‘r'- remove existing user account, ‘g'- generate list of user accounts, ‘q'-quit)

Output:

• List of user accounts, error messages when appropriate

• Output text file consisting of pairs of username and passwords, separated by a colon (:) without any spaces

Specification:

The program manages a list of user accounts and passwords supplied by a system administrator.

Any inputted username should be stripped of any non-alphanumeric characters (special characters such as ! @ # $ % ^ & * ( ) _ + ; : ' "), using regular expression substitution:

$username =~ s/[^a-zA-Z0-9]//g;
and should be converted to lowercase: $username = lc($username);

Any inputted password should be stripped of an apostrophe (other symbols are allowed):
$password =~ s/\'//g;

Each option should be implemented as a separate function within a Package that exports its functions, and the functions are referenced by a hash indexed by the user input (do not rename the input choices, or it will not work correctly when tested):

my %function = (‘a'=>\&add_user, ‘m'=>\&modify_user, ‘r'=>\&remove_user, ‘g'=>\&generate_list);
which can be called by assigning a variable to the key of the hash, such as: my $selection = $function{$choice};
and updating the list stored as a hash as: %hash = $selection->(\%hash) ;

Within each function, access the actual parameter %hash as a local parameter using the shift command: (eg: my $param = shift; my %local_hash = %$param) and update the hash according to the function. The script file (.pl) should import the functions from the package (.pm) file to call the appropriate function.

The program should loop until the user chooses to quit (selects status as ‘q'). If the user enters an illegal status, the program will prompt again for the status input. Upon quitting, the program prompts the user to save the list to a text file of the same name used to initially read the user list.

What to turn in:

A single zipped file (asmt1_yourlastname.zip) containing both source code files (the perl script called: asmt1_yourlastname.pl, and the perl module file called: functs_yourlastname.pm) submitted via Moodle (https://moodle.csun.edu) to the Lab section (not the lecture section). Any deviation from the format for submission will result in an automatic -10%.

Reference no: EM131210656

Questions Cloud

Tax-deductible interest : Given that an S&L is willing to lend money at an loan-to-value ratio of 75 percent. How much, if any, of this line would qualify as tax-deductible interest if their house originally cost $200,000?
Calculate the average of values stored in the rates array : The program should calculate the average of the values stored in the rates array. It then should display the average rate on the screen. Complete the program using the for statement. Save and then run the program.
What is the economic interpretation of this sing : What is the economic interpretation of this sing? Find Determine its sing. what is the economic interpretation of this sing? Find Determine its sing. What is the economic interpretation of this sing?
Digital image-processing machine : Gaia Research hospital purchased a digital image-processing machine three years ago at a cost of $45,000. The machine had an expected life of eight years at the time of purchase and an expected salvage value of $5,000 at the end of the eight years..
Write a program to manage a user list that can be modified : Write a program to manage a user list that can be modified and saved to a text file. Input text file consisting of pairs of usernames and passwords, separated by a colon (:) without any spaces.
Create a hotel management web application : CSCE 464/864 - Spring 2016 - Create a hotel management web application that can be used by two types of users: customers and clients. A customer is a user who intends to search for hotels and make reservations.
Percent what is the company waac : Miller Manufacturing has a target debt-equity ratio of .45, Its costs of equity is 13 percent, and its cost of debt is 7 percent. If the tax rate is 34 percent what is the company's WAAC
Prepare entries in the general fund to record : Prepare entries in the general fund to record the following transactions and events: - Estimated revenues for the fiscal year were $250,000 and appropriations were $248,000.
How does choice theory explain human behavior of individuals : How does choice theory explain the human behavior of individuals in the young and middle adulthood phases of the life span? How might you, as a social worker, incorporate components of the choice theory into your work with individuals in the young ..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd