2:13 PM
PARTIAL SOLUTION:
4) You can use Ihc codę shown heloss as a refercncc to start your program, or you can create your o«n program front scratch. The program bełoss shosss only the solution sshen the first player enters the letter K to sclcct rock.
einclude 'łtdafn.h' // uwd only for Microsoft einclude <1ottreaa> uslng uwipKt std:
1nt
ł
ł
aa1n(1nt argę. char* argv[J)
1
2
char playarl; // 1nput for Player
char player2: // Input for Player
char playAe*^ * 'v’i // loop contro!
paper or Klsiori" « endl;
cout « 'Inter a P or s for rock. do
cout « 'Player 1 (a P s): *; cln » playarl; cout « ‘'Player 2 (* P S): *; dn » player!;
// liu the uertlcal bart | for a logUal oa
«to alloa for dther upper or lo»er case lettert (playarl •• II playarl «• *r*>
1f (player! ~ «• II player! - *f) cout « "**obody «1n*' « endl: else 1f (player! — 'P' II player! ~ 'p')
cout « Paper couers rock - player ! arlna* « endl; elte 1f (player! — '*• II player! — •»')
cout « HOCk breakt sclssors - player 1 Mina* « endl;
else
cout « 'Illegal entry for player 2' «« endl;
// —— you need to conplete the codę for playarl encering P or S
eltei
cout « 'Ulegał entry for player 1“ « endl:
cout « "Oo you »ant to play epain’ cln »» playapaln:
) «h11e (playagaln — -V II playagam — *y*); // Capital and loeer t return 0:
<