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]
4 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]4 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
One of Kyle’s clients called to complain that his computer was running really slow. Kyle went to the client’s work area and star
12345 [234]

Answer:

The computer must be infected with malicious virus.

Explanation:

Since Kyle did a troubleshooting of the client’s computer by running Disk Defragmenter and Disk Clean-up utilities and found out, that the CPU was running several processes in the Windows task manager.

After restarting the computer, he noticed a long load time for Windows and saw several processes that he did not recognize.

This is obviously a sign of an infected system by a malicious virus.

Kyle should install an antivirus program such as Avast or Kaspersky on the computer and run a deep virus scan to detect any virus.

4 0
3 years ago
For the function definition int SomeFunc( /* in */ int alpha, /* in */ int beta ) { int gamma; alpha = alpha + beta; gamma = 2 *
Sonbull [250]

Answer:

A function post-condition refers to what will happen  and return after calling the function.

Given the function definition as follows:

  1. int SomeFunc( /* in */ int alpha, /* in */ int beta )
  2. {
  3.    int gamma;
  4.    alpha = alpha + beta;
  5.    gamma = 2 * alpha;
  6.    return gamma;
  7. }

If we call the function by passing two values, 3 and 4, as input parameters, the 3 will be captured by alpha and 4 by beta. The two input values will by calculated based on the formula defined inside the function as follows:

alpha = 3 + 4 = 7

gamma = 2 * 7 = 14

At last the function will return 14.

3 0
4 years ago
Read 2 more answers
How to be cool idk who can awnser this but i know the cleetus can
Pepsi [2]
Just be cooler than everyone else
8 0
4 years ago
Read 2 more answers
You locate a web page that includes "edu" in the address, along with other words and symbols. the page is simple—a plain backgro
stich3 [128]
No, just because it is an edu address doesn't mean it is a good source. Avoid websites with minimal content or effort to the page they are most likely fake. <span />
7 0
4 years ago
In order to control access to a company's intranet and other internal networks, all communications pass through a _____ server.
katen-ka-za [31]

Answer:

Web server

Explanation:

4 0
3 years ago
Other questions:
  • In a doubly linked list, every nodecontains the address of the next node and the previousnode except for the ____ node.
    8·1 answer
  • Two positive outcomes generally associated with modern computing are greater _____.
    12·2 answers
  • Write the equivalent c++ expression for the following algebraic expressions
    11·1 answer
  • Types of relationships include aggregation, composition, link, generalization, and specialization 9. TRUE FALSE
    9·1 answer
  • A collection is a container object (data structure) that represents a group of objects often referred to as data or elements of
    6·1 answer
  • List all the components of a computer
    14·2 answers
  • Read the Python program below: num1 = int(input()) num2 = 10 + num1 * 2 print(num2) num1 = 20 print(num1) Question 1 When this p
    6·1 answer
  • I have crummy WiFi and a bad pc. If I get a gaming computer, will it improve my FPS or ping?
    14·2 answers
  • Walter has an associate's degree in computer science and aspires to become a web developer. Which certification will help enhanc
    14·1 answer
  • Which tool can you use to display hardware utilization statistics that tell you about the operation of your computer?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!