2023 I need to fix the following code of the game Paper rock Scissor I have the code but there | Assignment Collections

Computer Science 2023 C++ programming!

2023 I need to fix the following code of the game Paper rock Scissor I have the code but there | Assignment Collections

I need to fix the following code of the game ” Paper, rock ,Scissor”

 

I have the code but there is a mistake in it

 

When Player1 Enter correct input (for example the input is r, R, p, P, s, S ) AND Player 2 Enter correct input>>>>>> There is no problem in the code.

 

When Player1 Enter Wrong input (for example the input is w, m, y or any letter ) AND Player 2 Enter wrong input>>>>>> There is no problem in the code.

 

 

BUT when Player1 enter  CORRECT input and Player 2 enter WRONG input, then I have problem in the code.

 

Could you fix the code PLEASE????

 

My code is:

 

 

#include <iostream>

 

using namespace std;

 

int main()

{

    char input1, input2, repeat;

    do {

        cout << “Player-1 turn! Enter your move. For rock press r/R, for paper press p/P, and for scissor press s/S, please! ” << endl;

        cin >> input1;

        cout << “Player-2 turn! Enter your move. For rock press r/R, for paper press p/P, and for scissor press s/S please! ” << endl;

        cin >> input2;

 

        if  (input1 != ‘r’ && input1 != ‘R’   // if which checks the both inputs CLOSING

            && input1 != ‘p’ && input1 != ‘P’

            && input1 != ‘s’ && input1 != ‘S’

            && input2 != ‘r’ && input2 != ‘R’

            && input2 != ‘p’ && input2 != ‘P’

            && input2 != ‘s’ && input2 != ‘S’)

        {

            cout << “You have entered wrong input!! ” << endl;

        }

 

        else if (input1 == ‘r’ || input1 == ‘R’)

        {

            if (input2 == ‘p’ || input2 == ‘P’)

            {

                cout << “Paper defeat the rock!” << endl;

                cout << “Player 2 wins the game!” << endl;

            }

 

            else if (input2 == ‘s’ || input2 == ‘S’)

            {

                cout << “Scissor defeat the paper!” << endl;

                cout << “Player 1 wins the game!” << endl;

            }

 

            else // if input2 == ‘R’ || ‘r’

            {

                cout << “Rock will not defeat other rock!” << endl;

                cout << “Tie! Neither Player 1 nor Player 2 won the game! ” << endl;

            }

        } // CLOSING LOOP for player 1 when he input R

 

        else if (input1 == ‘p’ || input1 == ‘P’)

        {

            if ((input2 == ‘r’) || (input2 == ‘R’))

            {

                cout << “Paper defeats rock!” << endl;

                cout << “Player 1 is the winner!” << endl;

            }

 

            else if ((input2 == ‘p’) || (input2 == ‘P’))

            {

                cout << “Paper will not defeat other paper!” << endl;

                cout << “Tie! Neither Player 1 nor Player 2 won the game! ” << endl;

            }

 

            else //if (input2 == ‘s’ || input2 == ‘S’)

            {

                cout << “Scissor will defeat paper!” << endl;

                cout << “Player 2 is the winner!” << endl;

            }

        } // CLOSING LOOP if the 1st player enters p or P

 

        else //if (input1 == ‘s’ || input1 == ‘S’)

        {

            if ((input2 == ‘r’) || (input2 == ‘R’))

            {

                cout << ” Rock will defeat scissor” << endl;

                cout << “Player 2 is the winner!” << endl;

            }

 

            else if (input2 == ‘p’ || input2 == ‘P’)

            {

                cout << “Scissor will defeat paper” << endl;

                cout << “Player 1 is the winner!” << endl;

            }

 

            else //if Player 2 choose ‘S’||’s’

            {

            cout << “Scissor will not defeat other scissor! ” << endl;

            cout << “Tie! Neither Player 1 nor Player 2 won the game! ” << endl;

            }

        } //CLOSING LOOP if player 1 choose scissor

 

        cout << “Do You Want to play again?” << endl;        // Ask the player if he want to repeat the game

        cout << “Press Y for Yes or any key to quit the game!” << endl;

        cin >> repeat;

 

    } while ((repeat == ‘Y’) ||(repeat == ‘y’)); //do while CLOSING

 

    return 0;

} // main int CLOSING

 

We give our students 100% satisfaction with their assignments, which is one of the most important reasons students prefer us to other helpers. Our professional group and planners have more than ten years of rich experience. The only reason is that we have successfully helped more than 100000 students with their assignments on our inception days. Our expert group has more than 2200 professionals in different topics, and that is not all; we get more than 300 jobs every day more than 90% of the assignment get the conversion for payment.

Place Order Now

#write essay #research paper #blog writing #article writing #academic writer #reflective paper #essay pro #types of essays #write my essay #reflective essay #paper writer #essay writing service #essay writer free #essay helper #write my paper #assignment writer #write my essay for me #write an essay for me #uk essay #thesis writer #dissertation writing services #writing a research paper #academic essay #dissertation help #easy essay #do my essay #paper writing service #buy essay #essay writing help #essay service #dissertation writing #online essay writer #write my paper for me #types of essay writing #essay writing website #write my essay for free #reflective report #type my essay #thesis writing services #write paper for me #research paper writing service #essay paper #professional essay writers #write my essay online #essay help online #write my research paper #dissertation writing help #websites that write papers for you for free #write my essay for me cheap #pay someone to write my paper #pay someone to write my research paper #Essaywriting #Academicwriting #Assignmenthelp #Nursingassignment #Nursinghomework #Psychologyassignment #Physicsassignment #Philosophyassignment #Religionassignment #History #Writing #writingtips #Students #universityassignment #onlinewriting #savvyessaywriters #onlineprowriters #assignmentcollection #excelsiorwriters #writinghub #study #exclusivewritings #myassignmentgeek #expertwriters #art #transcription #grammer #college #highschool #StudentsHelpingStudents #studentshirt #StudentShoe #StudentShoes #studentshoponline #studentshopping #studentshouse #StudentShoutout #studentshowcase2017 #StudentsHub #studentsieuczy #StudentsIn #studentsinberlin #studentsinbusiness #StudentsInDubai #studentsininternational