Design an algorithm that will prompt the user for the numerical value of two cards. The program will receive the two numbers and display their sum on the screen. If the calculated sum is 21, an asterisk is to be displayed beside the sum.

The program shall end when two zeros are entered.The program shall print a welcome message when it is first started and an goodbye message when it terminates.

Bonus:

Modify the algorithm to allow the user to enter the face cards as J,Q,K or A. If the user enters J, Q, or K then convert the entered value to 10. If the user enters A then count the value as 11 points.

Bonus Bonus:

Modify the algorithm to allow the user who receives the A to designate it either as 1 or 11.

Objective

  • Define the problem by constructing an algorithm using pseudocode
  • Create an IPO diagram showing input, output, and processing steps
  • What control structures (sequence, selection and repetition) are required?
  • What variables are required?
  • Show a check of your solution with test data for at least two valid test cases

results matching ""

    No results matching ""