1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
zhuklara [117]
3 years ago
7

Write a statement that compares the values of score1 and score2 and takes the following actions. When score1 exceeds score2, the

message "player1 wins" is printed to standard out. When score2 exceeds score1, the message "player2 wins" is printed to standard out. In each case, the variables player1Wins, player1Losses, player2Wins, and player2Losses, are incremented when appropriate. Finally, in the event of a tie, the message "tie" is printed and the variable tieCount is incremented.
Computers and Technology
1 answer:
Citrus2011 [14]3 years ago
6 0

Answer:

Following are the statement in the C++ Programming Language.

//check condition that score1 is greater than score2

if (score1 > score2)

{//print the message  and brake line

cout << "player1 wins" << endl;

//increment in the variable by 1

++player1Wins;

//increment in the variable by 1

++player2Losses;

}

//check condition when score2 is greater than score1

else if (score2 > score1)

{ //print the message  and brake line

cout << "player2 wins" << endl;

//increment in the variable by 1

++player2Wins;

//increment in the variable by 1

++player1Losses;

}

//otherwise

else

{ //print the message  and brake line

cout << "tie" << endl;

//increment in the variable by 1

++tieCount;

}

Explanation:

<u>Following are the description of the program</u>.

  • In the statement, we check that the variable 'score1' is greater than 'score2' then, print message and brake line, then increment in the variables by 1 that is 'player1Wins' and 'player2Losses'.
  • Again check that the variable 'score2' is greater than 'score1' then, print message and brake line, then increment in the variables by 1 that is 'player2Wins' and 'player1Losses'.
  • Otherwise, print the following message and break line then, increment in the variable 'tieCount'
You might be interested in
Briefly explain how an operating system may be described as an "interrupt-driven program." as system calls) from
Reptile [31]

Answer: Interrupt-driven program is defined as the program that permits to executes by stopping the execution of the currently running program.The completion of the program is indicated by the interrupt as a signal from assistant action .

Operating system is the system that carries out the functions and task of computer system.It has the major mechanism in which every alteration and changes are remarked such as state of hardware, event alteration, software component changes etc by the interrupt system.

Through interrupt system the operating system conducts new assignment and task for the compensation of changes that occurred in the system by halting the current working. Resources are invoked to fulfill the requirement of the work load.Thus, operating system can act in interrupt driven system's  manner.

7 0
3 years ago
Using the =na() function in a cell, makes it clear that data is not _______ and hasn't been ______ accidentally.
inysia [295]
Show the cost to rent different items
5 0
3 years ago
Universal Containers sells its products online using a system built on Force Sites. The orders are captured and processed in Sal
sveta [45]

Answer:

Use Outbound Messages to send customer data from Salesforce to the marketing system.

Use a middleware tool to pull customer data from Salesforce and push it to the marketing system on a daily basis

Use Apex callout to send customer data from Salesforce to the marketing system

Explanation:

The above points illustrates a mechanism for moving cutomer data to the marketing system efficiently.

3 0
3 years ago
Showrooming is associated with apps designed to fulfill which primary motivation?
Luden [163]
300 because it was good for it
6 0
2 years ago
Which statement most thoroughly describes the profession of an engineer​
Free_Kalibri [48]

Answer:

During the engineering design process, the responsibilities of the engineer may include defining problems, conducting and narrowing research, analyzing criteria, finding and analyzing solutions, and making decisions. Much of an engineer's time is spent on researching, locating, applying, and transferring information.

Explanation:

5 0
3 years ago
Other questions:
  • The layout button is located in the ____ group on the home tab?
    14·1 answer
  • I would A lot of knowledge and education for computers and <br> Technology
    10·2 answers
  • Hurry plz
    8·1 answer
  • Who are the founders of Microsoft?
    5·1 answer
  • Determine the exact output of the code $str = "The quick brown fox jumps over the the lazy dog"; echo strpos($str, 'fox');
    6·1 answer
  • What does Digital Citizenship mean to you?
    14·1 answer
  • Genres are useful for many reaseons. What are some explanations you can think of for how genres can be useful to players, game d
    5·1 answer
  • Algunos de los navegadores que existen son:
    12·1 answer
  • Help pls<br> cmu cs 0<br> 4.1.2.1 Creating Groups checkpoint 1
    11·2 answers
  • Can someone help me debug this please
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!