check50

cs50/problems/2022/python/coke


:) coke.py exists

Log
checking that coke.py exists...

:( coke accepts 25 cents

Cause
Did not find "Amount Due: 25..." in "Amount Due:  2..."

Log
running python3 coke.py...
sending input 25...
checking for output "Amount Due: 25\n"...

Could not find the following in the output:
Amount Due: 25
Actual Output:
Amount Due:  25
Insert Coin: 

:( coke accepts 10 cents

Cause
Did not find "Amount Due: 40..." in "Amount Due:  4..."

Log
running python3 coke.py...
sending input 10...
checking for output "Amount Due: 40\n"...

Could not find the following in the output:
Amount Due: 40
Actual Output:
Amount Due:  40
Insert Coin: 

:( coke accepts 5 cents

Cause
Did not find "Amount Due: 45..." in "Amount Due:  4..."

Log
running python3 coke.py...
sending input 5...
checking for output "Amount Due: 45\n"...

Could not find the following in the output:
Amount Due: 45
Actual Output:
Amount Due:  45
Insert Coin: 

:( coke rejects invalid amount of cents

Cause
Did not find "Amount Due: 50..." in "Insert Coin: "

Log
running python3 coke.py...
sending input 30...
checking for output "Amount Due: 50\n"...

Could not find the following in the output:
Amount Due: 50
Actual Output:
Insert Coin: 

:( coke accepts continued input

Cause
Did not find "Amount Due: 30..." in "Amount Due:  3..."

Log
running python3 coke.py...
sending input 10...
sending input 10...
checking for output "Amount Due: 30\n"...

Could not find the following in the output:
Amount Due: 30
Actual Output:
Amount Due:  30
Insert Coin: 

:( coke terminates at 50 cents

Cause
expected "Change Owed: 0...", not "Change Owed:  ..."

Log
running python3 coke.py...
sending input 10...
sending input 10...
sending input 10...
sending input 10...
sending input 10...
checking for output "Change Owed: 0\n"...

Expected Output:
Change Owed: 0
Actual Output:
Change Owed:  0

:( coke provides correct change

Cause
expected "Change Owed: 1...", not "Change Owed:  ..."

Log
running python3 coke.py...
sending input 25...
sending input 10...
sending input 25...
checking for output "Change Owed: 10\n"...

Expected Output:
Change Owed: 10
Actual Output:
Change Owed:  10