Question: c++ Programming Exercise 6.8 The Game Of War, V.1.0 1. 2. 3. Purpose. Write a simple program from scratch that uses if-logio. The game is
c++Programming Exercise 6.8 The Game Of War, V.1.0 1. 2. 3. Purpose. Write a simple program from scratch that uses if-logio. The game is played between the computer and a human player Supplemental . Read about "randomizing in www.rdb3.com/epplexercises/Gaming supplemental pat. Requirements. Write the program wari.cpp, based on the card game war (www.pagat.com/war/war.htm), following this algorithm: Algorithm. Call srand Compute and store the computer's card's value (2-14) using the random number generator Output the computer's card's value, outputting 2-10 as that value, but output 11 as Jack, 12 as Queen, 13 as King, and 14 as Ace Get and store the computer's card's suit (0-3) using the random number generator 5. Output the computer's card's suit, but output o as Spades, 1 as Diamonds, 2 as Hearts, and 3 as clubs 6. Get and store the human's card's value (2-14) using the random number generator 7. Output the human's card's value, outputting 2-10 as that value, but output 11 as Jack, 12 as Queen, 13 as King, and 14 as Ace 8. Get and store the human's card's suit (0-3) using the random number generator 9. Output the human's card's suit, but output 0 as Spades, 1 as Diamonds, 2 as Hearts, and 3 as Clubs 10. If the computer's card's value is less than the human's card's value, output "Human wins!" 11. If the computer's card's value is EQUAL TO the human's card's value, output "It's a tie. 12. If the computer's card's value is GREATER than the human's card's value, output "Computer wins
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
