CSCI 107 Assignment 2
Due Date and Submission Requirements
- Due Date: Friday, February 3rd no later than 11:59 p.m.
- Partner Information: Everyone must complete this assignment
individually.
- Submission Instructions: Upload your solution, entitled
YourFirstName-YourLastName-Assignment2.py
to the BrightSpace Assignment 2 Dropbox.
- Deadline Reminder: Once the submission deadline passes, BrightSpace
will no longer accept your submission and you will no longer be able
to earn credit. Thus, if you are not able to fully complete the
assignment, submit whatever you have before the deadline so that
partial credit can be earned.
Python Business Card, Part II - 100 points
Purpose
Parasail Capital was extremely pleased with your business card
solution. They would like you to modify that solution so that
it works for any first name, last name and phone number.
More specifically, your solution should ask the user to enter
each of these three pieces of information separately. The program
should then print the appropriate business card.
Note: It is a common task for a computer scientist to enhance
the functionality of an existing program.
Sample Transcript
The sample transcript below shows what might happen
when Champ Bobcat runs your program. Information to the
right of the prompt (:) is entered by the user.
Please enter your first name: Champ
Please enter your last name: Bobcat
Please enter your telephone number: (406)-994-4636
Here is your business card.
+------------------------------------------------+
| | |
| -| Bobcat, Champ |
| --| Tribute Liabilities Associate |
| ---| Parasail Capital |
| --------- |
| ------- 4 Hunger Plaza |
| STE 1400 |
| District 12, Panem 00012 |
| |
| Work: (406)-994-4636 @: champ@parasail.com |
+------------------------------------------------+
Assumptions
- Assume the person's first name has no more than 9 characters.
- Assume the person's last name has no more than 10 characters.
- Assume the person's telephone number is entered in the format
(xxx)-xxx-xxxx where x is a digit between 0 and 9.
Required Python Comment
Place a Python comment at the top of your submission
that is formatted as follows.
# -----------------------------------------+
# Your name | <-- e.g. Mason Medina
# CSCI 107, Assignment 2 |
# Last Updated: Month Day, Year | <-- e.g. February 3, 2022
# -----------------------------------------|
# A brief description of the assignment. | <-- can be more than 1 line
# -----------------------------------------+
Grading
- 20 points - The user is prompted to enter their first name (4 points),
last name (4 points) and telephone number (4 points) using the
specified messages above (4 points) in the proper order (4 points).
- 10 points - The Here is your business card. message appears
with an empty line both before and after it.
- 10 points - Except for the first name, last name and telephone number,
the rest of the business card is identical to the one above.
- 20 points - The user's first and last name appear inside the
business card correctly (10 points) and the bar (|) to the right
of the entire name appears in the proper column, provided the
name is not too long (10 points).
- 10 points - The user's e-mail address appears following one space to the
right of @: (5 points) and the bar to the right of
the e-mail address appears in the proper column (5 points),
provided the first name is not too long.
- 10 points - The user's phone number appears inside the business
card correctly.
- 10 points - A Python comment appears at the top of the submission
in the format specified above.
- 10 points - The submitted file is named correctly.
Helpful Hint
Consider the following Python code:
color1 = "blue"
color2 = "gold"
print(color1.ljust(10) + color2)
sentence = color1 + "-" + color2
print(sentence)
When run, the code above will produce
blue gold
blue-gold
The ljust(10) has the effect of printing the word "blue" at the far
left (left justified) of a field of width 10.
What happens if you replace ljust(10) with rjust(10)?
With center(10)?