Ap CSP Writtenresponse - Xavier
Ap CSP Writtenresponse - Xavier
2a)
2b)
The algorithm in my program is a while loop that includes two if-else statements.
The while loop iterates evrytime a player makes a dicsion to hit or stand and
determines how close th eplyaer is to 21. The 1st If staement determines if the
layer has a 'bust'. Else the if statement finds if the player has 21, and if not it
promts trhe user to hit or stand again. The second if statement determines who
is winning the vurrent game and prints a message based of the number of wins
each player has, if pbust or cbust == false then that player wins and vice versa.
All in all, this progam helps the purpose of the program by promting thw user to
make a decision based on what number cards rhey already have and keeping
track of their past deciosn keep score, and the two if statements play the role of
a nnbiased dealer and imporve the overall efficiency of the program.