Write a code to perform card counting. First you have to evaluate the card whether it is Ace (A), Jack (J), Queen (Q), or King (K). If card is J, Q, and K then points will be 10. If card is Ace then points will be 11. For the rest of the cards points will be the card number e.g. card 3- points will be 3, card 4 – points will be 4 and so on. Now you have to perform card counting to track card number 10, Jack, Queen and King. You have to display “Count has gone up” message if the points is in between 3 and 6. If the points is 10 then you will display “Count has gone down”. a) Draw the flow chart of the above program. Also, write pseudo code of the above program. b) Implement the above code using conditional statements. Also, explain which control structure will be best for the above problem.
Max Function
Statistical function is of many categories. One of them is a MAX function. The MAX function returns the largest value from the list of arguments passed to it. MAX function always ignores the empty cells when performing the calculation.
Power Function
A power function is a type of single-term function. Its definition states that it is a variable containing a base value raised to a constant value acting as an exponent. This variable may also have a coefficient. For instance, the area of a circle can be given as:
Q no. 1:
Write a code to perform card counting. First you have to evaluate the card whether it is Ace (A),
Jack (J), Queen (Q), or King (K). If card is J, Q, and K then points will be 10. If card is Ace then
points will be 11. For the rest of the cards points will be the card number e.g. card 3- points will
be 3, card 4 – points will be 4 and so on.
Now you have to perform card counting to track card number 10, Jack, Queen and King. You
have to display “Count has gone up” message if the points is in between 3 and 6. If the points is
10 then you will display “Count has gone down”.
a) Draw the flow chart of the above program. Also, write pseudo code of the above
program.
b) Implement the above code using conditional statements. Also, explain which control
structure will be best for the above problem.
Step by step
Solved in 2 steps with 3 images