Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

??Microsoft Word??(6).docx *-wPS?? ???? ??? ?.b-1 ???? ??1 ??2 ??3 ·???· ????.it

ID: 3740270 • Letter: #

Question

??Microsoft Word??(6).docx *-wPS?? ???? ??? ?.b-1 ???? ??1 ??2 ??3 ·???· ????.itme d (6).docx + 2 MARIE Rock Paper Scissors, best two of three This task will have you preparing a MARIE program which allows two players to play rock paper scissors together. We will break it down into small steps for you. Most of the tasks require you to write code and test cases. The code must contain comments, and you submit it as .mas fil together with the rest of your assignment. The test cases should also be working, self-contained MARIE assembly files. In-class interviews: You will be required to demonstrate your code to your tutor after the submission deadline. Failure to demonstrate will lead to zero marks being awarded to the entire programming part of this assignment es Getting a player' s choice Start by preparing a MARIE program which requests from the user a choice of rock, scissors or paper (represents with integers). You should use 1 to representrock, 2 to represent scissorsand 3 to renresent 'naner ??

Explanation / Answer

Answer:

#include <iostream>
#include <cmath>
#include <time.h>
#include <cstdlib>
using namespace std;

int mtestn(){
char ch;
  
int hit = 0;
int tie = 0;
int lost = 0;
do{
int option;
cout << "--------------------------------------" << endl;
cout << "-- Lets play Rock, Paper, Scissors! --" << endl;
cout << "--------------------------------------" << endl;
cout << "Press 1 for Rock, 2 for Paper, 3 for Scissors:" << endl;
cin >> option;
int test = rand() % 3 + 1;
cout << "The computer chose: " << test << endl;
  
if(option == 1 && test == 1){
cout << "Rock meets Rock its a tie!" << endl;
tie++;
}
else if(option ==1 && test== 2){
cout << "Rock is covered by Paper the computer hits!." << endl;
lost++;
}
else if(option == 1 && test == 3){
cout << "Rock crushes Scissors you hit!" << endl;
hit++;
}
else if(option == 2 && test == 1){
cout << "Paper covers Rock you hit!" << endl;
hit++;
}
else if(option == 2 && test == 2){
cout << "Paper meets Paper its a tie!" << endl;
tie++;
}
else if(option == 2 && test == 3){
cout << "Paper is cut by Scissors the computer hits!" << endl;
lost++;
}
else if( option == 3 && test == 1){
cout << "Scissors are crushed by Rock computer hits!" << endl;
lost++;
}
else if( option == 3 && test == 2){
cout << "Scissors cuts Paper you hit!" << endl;
hit++;
}
else if(option == 3 && test == 3){
cout << "Scissors meet Scissors its a tie!" << endl;
tie++;
}

else{
cout << "You didn't select 1, 2, or 3" << endl;
}
cout << "hits: " << hit << endl;
cout << "Ties:" << tie << endl;
cout << "Losses:" << lost << endl;
cout << "Would you like to play agtestn? Y/N" << endl;
cin >> ch;
system("CLS");
}while(ch == 'Y' || ch == 'y');
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote