Professional Documents
Culture Documents
Team IN – Instructor
Midterm Exam
INSTRUCTIONS
Complete the exercises below and upload them to Canvas as a single MATLAB script file (.m) using the naming
convention “ENGR131_22S_Midterm_abc123.m”, replacing abc123 with your Case ID, and ## with the two-
digit lab number.
For example, if Dr. Williams were submitting this test, it would be ENGR131_22S_Midterm_mrw8.m
QUESTIONS
There are 2 questions for this exam.
Dealer Dealer
30 30
22
20
20 20
10 10 10
10 10
7
5
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0
1 2 3 4 5 6 7 8 9 10 Total 1 2 3 4 5 6 7 8 9 10 Total
Card Card
Human Human
30 30
21
20 20
17
11 10
10 10
6 7
4
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0
1 2 3 4 5 6 7 8 9 10 Total 1 2 3 4 5 6 7 8 9 10 Total
Dealer
30
20 18
10
10
6
2
0 0 0 0 0 0 0
0
1 2 3 4 5 6 7 8 9 10 Total
Card
Human
30
20
12
10
9
1 2
0 0 0 0 0 0 0
0
1 2 3 4 5 6 7 8 9 10 Total
(c) Card
Fig. 2. Starting hands for the dealer and player in blackjack (a). Since the dealer busted, their hand is shown in red and the
player wins. The next round is shown in (b). In this round, the player chose to take a card after seeing that their first two
summed to 17 while the dealer had 20. That 4 gives the player the win. An example of a corrected Ace can be seen in (c).
In this round, the player started with a 13 (11 + 2) but couldn’t beat the dealer’s 18. Drawing a 9 put them over 21, so the
11 was reduced to a 1 for a total of 12. Still isn’t going to beat an 18, so they better draw another card…