Question: For this assignment, you ll be writing a program to display summary information about a single user's account on the system. Here are the specifications

For this assignment, youll be writing a program to display summary information about a single
user's account on the system. Here are the specifications for your program. Make sure you read
and understand the requirements before proceeding:
1. Your program will take one command-line argument, which will be the name of the account
to summarize.
2. If no command-line argument is given or if too many command-line arguments are
provided, display a usage statement and exit the program without further processing. You
can assume that the account exists; no validation of this fact is necessary. The usage
statement should look something like this:
./lastsummary.py username
where you will replace ./lastsummary.py with the name of the currently running
program. Make sure to make this aspect of the usage statement dynamic and not hardcoded
as literally ./lastsummary.py .
3. If a single command-line argument is provided, your program will then process the output
from last and display a numbered summary of that accounts login activity as well as
including the following information: account name, how many logins were executed
(including currently logged in sessions), and the time in HH hours and MM minutes
format. HH and MM should be two digits with leading 0s if necessary. See the example runs
for samples of how your output should look.
Output requirements
1. You must display each login entry, prefaced by a login # (sequential numbers starting at 1).
See the final page for a complete example of the output.
2. Make sure your final output follows this formatting, where the time should be in the format
HH hours and MM minutes , where HH and MM (hours and minutes) should both
be two digits in length, including leading 0s if necessary. The user's full account name,
logins and time should each be displayed on separate lines in that order at the end of all
other output:
Account: ACCOUNT_NAME
Total logins: TOTAL_LOGINS
HH hours and MM minutes
replacing ACCOUNT_NAME , TOTAL_LOGINS , HH , and MM as apporpriate.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!