Reference no: EM131322730
Programming Problem
Write a Python script called passmerger that will merge the contents of two simplified user account tables in a database as described below. The script uses one command line argument that represents the name of the database file. This name should he validated.
The simple account database contains two tables of accounts. Each entry in these tables has three fields (all text strings) - the username, the encrypted password, and a home directory location like this:
eggert kljsdfjkl /home/eggert
All regular account home directories are in the /home directory based on the account name as given above. Special system account names begin with the word system and have a home directory value of None.
Create a third table in the database with similar fields that represents the merger of the data from the other two tables according to the following rules.
• a system account in the first table should have its entry included just as it is, no changes.
• a system account in the second table should not be included in the merged table.
• an account in either table that is not listed in the other table should have its entry included just as it is, no changes.
• an account that is listed in both tables should have two entries. For the first, the account name should be changed to append _1 to the name in the first field, the password should stay the same, and the home directory location should have a 1_ inserted before the name. For the second entry, the account name should be changed to append _2 to the name in the first field, the password should stay the same, and the home directory location should have a 2_ inserted before the name.
Below is an example showing how these rules apply.
Table 1 accounts:
fred ksdfjsl /home/fred
systeml abc None
wilma skai9e /home/wilma
Table 2 accounts:
barney mmaam /home/barney
wilma oiwehh /home/Wilma
system2 abc None
Merged table accounts:
fred ksdfjsl /home/fred
systeml abc None
wilma _l skai9e /home/1_wilma
wilma_2 oiwehh /home/2_wilma
barney mmaam /home/barney
The modified database should be saved back to the disk before the program ends.
Employ to encourage the parents or caregivers
: Taking into account the parents' and caregivers' potential sensitivities, list at least three specific questions you would ask about the child to gather more information. Provide at least two strategies you could employ to encourage the parents or..
|
Does entitlement appear to mediate effects of narcissism
: After entitlement was entered in Step 1 of the regression equation, entitlement accounted for 3% of the variance in rage when it was entered in Step 2. Does entitlement appear to mediate the effects of narcissism on rage?
|
What is the intrinsic value of the common shares today
: A company pays a $0.50 dividend. The dividend is expected to grow at a 20% rate for the next two years. Thereafter, over the subsequent three years, its growth should decline linearly, ultimately reaching a stable, mature growth rate of 5% per year. ..
|
Crate and barrel facilitate consumer purchases
: How does Crate and Barrel facilitate consumer purchases with its multichannel strategy?
|
Write a python script called passmerger that merge contents
: CSCI 3351: Write a Python script called passmerger that will merge the contents of two simplified user account tables in a database as described below. The script uses one command line argument that represents the name of the database file.
|
Challenges do consultancy firms face
: What special challenges do consultancy firms face that firms operating all items in-house do not?
|
Preventing workplace discrimination simulation
: Resource: Preventing Workplace Discrimination Simulation Complete the Preventing Workplace Discrimination Simulation Write a 350- to 700-word summary that addresses the following:
|
In given cross lagged panel design does x appear to cause y
: In the given cross-lagged panel design, does X appear to cause Y, does Y appear to cause X, do both variables influence each other, or are X and Y unrelated?
|
What is the yield to maturity-what is the price of the bond
: What is the price of a $1,000 face value bond with ten years to maturity if investors require a 7% return and the bond has a coupon rate of 10%? What is the yield to maturity (total yield) on a $1,000 bond selling for 113.42 if the bond has a coupon ..
|