CPSC 231: Mini-Assignment 2A
Due
Friday Oct 7 at 4 PM
New Concepts to be applied for the assignment
- Branching/decision making using the if-construct
Description:
Write a simple retail POS (Point of sale) application program that will
calculate the final price of a product by including a discount (3% off the price
when the 'sticker price' is $100,000 or higher) when applicable as well the
price after GST:
- The program prompt (and gets) user input for the base price of the product (the price listed
online or on the sticker in the store): Worth 0.5 grade points
- The program determines if the discount is applicable and if so reduces
the price of the product. Worth 2 grade points
- Displays the original sticker price of the product: Worth 0.5 grade
points
- Calculates and displays the GST (it's based on the price after the
discount has been applied, if applicable): Worth 0.5 grade points
- Calculates and displays the final price of the product after discounts
and tax have been applied: Worth 0.5 grade points
A student that completes the above 5 features will receive a grade point of:
0.5 + 2 + 0.5 + 0.5 + 0.5 = 4.0 or the equivalent of an 'A'.
Prices are in dollar values with cents being represented as fractional
digits e.g. $1.99. The display of monetary values should follow common
conventions (only two fractional digits should be displayed).
Marking spreadsheet
Points to keep in mind:
- Due time: All assignments are due at 4 PM on the
due dates
listed on the course web page. Late assignments or components of
assignments will not be accepted for marking without approval for an
extension beforehand. What you have submitted in D2L as of the due date is
what will be marked.
- Extensions may be granted for reasonable cases by the course
instructor with the receipt of the appropriate documentation (e.g., a
doctor's note). Typical examples of reasonable cases for an extension
include: illness or a death in the family. Cases where extensions will not
be granted include situations that are typical of student life: having
multiple due dates, work commitments etc. Tutorial instructors (TA's) will
not be able to provide extension on their own and must receive permission
from the course instructor first. (Note: Forgetting to hand your assignment
or a component of your assignment in does not constitute a sufficient reason
for handing your assignment late).
- Method of submission: You are to submit your assignment using D2L
[help
link]. Make sure that you [check
the contents of your submitted files] (e.g., is the file okay or was it
corrupted, is it the correct version etc.). It's your responsibility to do
this! (Make sure that your submit your assignment with enough time before it
comes due for you to do a check).
- Identifying information: All assignments should include contact
information (full name and student ID number) at the very top of your
program in the class where the 'main()'
function/method resides.
- Collaboration: Assignments must reflect individual work,
group work is not allowed in this class nor can you copy the work of
others. For more detailed information as to what constitutes academic
misconduct (i.e., cheating) for this course please read the following [link].
- Execution: programs must run on the computer science network
running Python 3.x. If
you write you code in the lab and work remotely using a remote login program
such as Putty or SSH. If you choose to install Python on your own computer
then it is your responsibility to ensure that your program will run properly
here. It's not recommended that you use an IDE for writing your programs but
if you use one then make sure that you submit your program in the form of
text ".py" file or files
- Use of pre-created Python libraries: unless otherwise told you
are to write the code yourself and not use any pre-created functions from
the Python libraries. For this assignment acceptable functions include:
print(), input().