assignment 2 intro to programming cis and 122 or sonia xu description
Question
Assignment 2
Intro to Programming
CIS&122 | Sonia Xu
Description
Work off the program you created in assignment 1, and update the program so
it allows the user to make as many sales entries as they want and to display
the quarter that the sales occurred in.
Console Output
The bolded and underlined text indicate user input. Everything else should be
displayed from the program. The user input serves as an example of how the
program works. You can test your program however you'd like.
DataViewer Program
This program will accept user input for
sales data for three days. After three
inputs the program will display the total
amount and exit.
Enter sales data
Amount:
Year:
Month (1-12)
Day (1-31):
1.
Enter more sales? (y/n): z
1234
2020
10
2020-5-10 Quarter 2 $1234.0
Amount:
Year:
Month (1-12):
Day (1-31):
2.
875
2020
8
2020-8-12
Assignment 2
Amount:
Year:
Month (1-12) :
Day (1-31):
3.
Enter more sales? (y/n): z
1241
2020
10
11
Quarter 3 $875.0
Enter more sales? (y/n):
Total Sales
$3350.0
Program exit.
1
2020-10-11 Quarter 4 $1241.0/nAssignment 2
Intro to Programming
CIS&122 | Sonia Xu
Specifications
• The program should continue if the user enters 'y' or "Y".
• The program should accept float entries for the amount and integer entries
for the year, month, and day. An error should occur if you try to input a float
entry for the year, month, or day.
•
You can assume the user will enter valid data.
• Determine the quarter based on the month value:
Quarters
1
2
3
Months
1, 2, 3
4, 5, 6
7, 8, 9
10, 11, 12
• Each time an entry is inputted from the user, the program should display a
summary of the input: entry number, date, and the amount. Please pay
attention to the syntax and spacing, the program should display it exactly
as shown.
• Overall, pay attention to syntax and spacing, the program should display it
exactly as shown in the console output example.
What will be graded....
• File header comment
• Program code, syntax and spacing, code organization
• Program can run and output information to the interactive shell
• Files are labeled as requested
o Name the python file: assignment2-<your-last-name>.py
o Please also submit a screenshot of the interactive shell when your
program is executed. Name it: assignment2-screenshot-<your-
last-name>.jpg
Submission - 2 files
• Python file
• Screenshot of the interactive shell output
Submissions will only be accepted via Canvas uploads.
2