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%.
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 ..
|