Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void CardSum(int val1, int val2, int val3, int val4, int &total)
- /*Takes the values of three cards as val1, val2, and val3, changes the value to 10 if a value is greater than 10, sums them, and outputs their totals
- val1 >= 0 && val1 <= 14, val2 >= 0 && val2 <= 14, val3 >= 0 && val3 <= 14, val4 >= 0 && val4 <= 14
- Returns the sum of the values as total*/
- {
- if (val1 == 12 || val1 == 13 || val1 == 14)
- {
- val1 = 10;
- }
- if (val2 == 12 || val2 == 13 || val2 == 14)
- {
- val2 = 10;
- }
- if (val3 == 12 || val3 == 13 || val3 == 14)
- {
- val3 = 10;
- }
- if (val4 == 12 || val4 == 13 || val4 == 14)
- {
- val4 = 10;
- }
- total = 0;
- total = val1 + val2 + val3 + val4;
- }
Advertisement
Add Comment
Please, Sign In to add comment