Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Homework 06-Conditionals Function Name: civilkar Inputs: 1. 2. (char) Player 1's move (char) Player 2's mowe Outputs: 1. (char) A statement descibing which player wor
Homework 06-Conditionals Function Name: civilkar Inputs: 1. 2. (char) Player 1's move (char) Player 2's mowe Outputs: 1. (char) A statement descibing which player wor Background: You and your friends decide to play but immediately get bored. Then you remember Marvel's new movie Black Panther is almost in theaters and decide to spruce up the classic game to include your favorite Avengers. Once you agree upon the rules, you write a MATLAB functon to determine the winner of each round. Function Description: Write a tunction that takes in and compares two of the following strings. These are the ONLY inputs we will use to test your function Captain Aterica Black Widow Hawkeye Black Panther Iron Man Then compare them by the folowing rules (look on the following page for a graphic) 1. Black Panther beats both Captain America and Hawkeye. 2. Captain America beats both Iron Man and Black Widow 3. ron Man beats both Black Panther and Hawkeye. 4. Hawkeye beats both Captain America and Black Widow. 5. Black Widow beats both Black Panther and Iron Man. It should output one of the following strings: Player 1 wins! if player 1 wins Player 2 wins! if player 2 wins It' s a tie!' if both players choose the same move
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started