Computer Science- Python Python Programming Assignment
Page 1 of 3 NorQuest College – CMPT 1011: Lab Assignment 3
CMPT 1011: Introduction to Computing
Lab Assignment 3: Payment Calculator
Value
This assignment is worth 3% of your final grade.
Background
In this assignment you will be practicing using Python programming for problem solving. You
want to use the proper arithmetic operation and calculate and print the proper value for the
scenario described below.
This assignment relates to the following General Learning Outcomes:
1. Define programming to solve problems
2. Examine different data types and manipulating variables
Instructions
1. Use Intellij Idea write your code and make sure it works for couple of examples. Use this
problem to calculate and print the proper amount of minimum payment for the following
problem:
A credit card company calculates a customer's "minimum payment" according to the
following formula. The minimum payment is equal to either $10 or 19.9% of the
customer's balance, whichever is greater; but if this exceeds the balance, then the
minimum payment will be the balance. Write a program to print out the minimum payment
using Python built-in functions min and max.
Example 1: If your balance is 1000, then your program should print "The minimum
payment is 199".
Example 2: If your balance is 600, then your program should print "The minimum
payment is 119.40".
Example 3: If your balance is 25, then your program should print "The minimum
payment is 10".
Example 4: If your balance is 8, then your program should print "The minimum
payment is 8".
You should start your program like this:
Hello User! What is your balance? <Balance>
Your balance is <Balance>.
The minimum payment is <Minimum Payment>.
Page 2 of 3 NorQuest College – CMPT 1011: Lab Assignment 3
Note that <Balance> is your total balance that you start off with. <Minimum payment> is
the minimum payment you have calculated with the above conditions.
2. Please consider all the conditions, as the input could also be a negative number or an
invalid input (string, Nonetype etc.). If user inputs a wrong balance the program outputs:
“Invalid input”
3. Submit your "<FirstName>_<LastName>_Lab3.py" file to the Moodle assignment box.
4. Deadlines will be announced in Moodle. Consider this assignment your opportunity to
integrate what you’ve learned throughout the course.
5. You will be assessed using the rubric provided.
Assignment Rubric (Total: __/15 marks)
5 3 2 1
Does Not
Meet
Expectations
0
Use
assignment
expression to
define the
proper
variables
All the
variables are
defined
correctly with
proper
assignment
expression
Some
variables
are defined
correctly
with
proper
assignment
expression
No variables
are defined
correctly with
proper
assignment
expression
No evidence
Using min and
max functions
All the
arithmetic
operations
are applied
correctly
Some of the
arithmetic
operations
are applied
correctly
Just one of the
arithmetic
operations are
applied
correctly
No evidence
Print the
values
The correct
amount is
printed with
all proper
message
The correct
amount is
printed
without
proper
message
The correct
amount is
printed
with no
message
The incorrect
amount is
printed with
no proper
message
No evidence
Correct
filename and
good
documentation
Filename
saved
correctly
and
submitted
as a
python file
Filename
partially
correct and
submitted as a
python
No evidence
Page 3 of 3 NorQuest College – CMPT 1011: Lab Assignment 3
5 3 2 1
Does Not
Meet
Expectations
0
Bonus: Not
using
if/else/elif
statements
Did not use
if/else/elif
statements
and
correctly
showed
the results
Did not use
if/else/elif
statements
but has some
small
inconsistencies
in code
No evidence