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
Tatiana [17]
3 years ago
11

i need to also do a algorithm where if the total is a even number 10 points are added to the score and if the total is odd then

5 points are subtracted. i have the part about the 10+ or 5- but im not sure how to do the even or odd number variable. help would be appreciated :) (im using python)
Computers and Technology
1 answer:
algol [13]3 years ago
5 0

Answer:

def UpdateScore(score, total):

   if total % 2:

       print total, "is odd, so adding 10"

       score += 10

   else:

       print total, "is even, so subtracting 5"

       score -= 5

   print "The score is now",score

   return score

score = 0

score = UpdateScore(score, 3)

score = UpdateScore(score, 6)

Explanation:

The % operator returns the remainder after division. So if you divide by 2, the remainder is either 0 or 1, where 0 indicates an even number, and 1 indicates an odd number. The above program shows that.

You might be interested in
What information is used in a communication between two system
xz_007 [3.2K]

Answer:

IPv4 address. I guess, it's kind of tricky. lol

6 0
3 years ago
Jason takes many photographs on his smartphone while on vacation in italy. If jason wants to access these pictures across multip
White raven [17]

Answer:

Probably in the cloud, or online, like G Photos

8 0
2 years ago
N the following pseudocode, what percentage raise will an employee in Department 8 receive?
goldenfox [79]

Answer:

"MEDIUM_RAISE" is the correct answer for the above question.

Explanation:

  • In the above pseudo-code, The first if statement will false because the question suggests that the department value is 8, which is greater than 5. But the first if statement states that the department value is less than 5.
  • Then the else-if statement gets checked which gives the true result. It is because the value of the department variable is 8, which is less than 14.
  • So the else-if statement block will be executed which assigns the MEDIUM_RAISE value to the raise.
  • Hence the answer is "MEDIUM_RAISE".

4 0
3 years ago
On many advanced routers and switches, you can implement QoS through bandwidth management, such as __________, where you control
Mila [183]

Answer:

c. traffic shaping

Explanation:

A traffic shaping system is one that allows to adapt the incoming data traffic that comes from some node of the network giving it a special treatment called conformation of accepted traffic and thus allowing the frames to be forwarded through the network of data under traffic rules without having gone through some traffic shaping method, this can be detected as non-conforming traffic at the edge of access to the discarded metropolitan network.

Traffic shaping is a mechanism that alters the traffic characteristics of the cell flow of a connection to achieve better network efficiency while maintaining QoS objectives or in order to ensure that the cell flow conforms to traffic parameters according to the leaky bucket algorithm configuration of the traffic contract. Traffic shaping can be used in ATM, for example, to reduce peak speed, limit the length of the burst by means of adequate spacing of cells over time. The use and location of this function is network specific.

5 0
3 years ago
What is the name of the top-level parentless folder in a digital file system?
Viefleur [7K]

Answer:

ROOT

Explanation:

6 0
3 years ago
Other questions:
  • Trish uas bought a new computer, which she plans to start working on aftwr a week. Since Trish has not used computers in the pas
    13·1 answer
  • Triangle O N M is cut by line segment L K. Line segment L K goes from side N O to side N M. The length of N L is x, the length o
    8·2 answers
  • How does kinetic energy affect the stopping distance of a vehicle traveling at 30 mph compared to the same vehicle traveling at
    6·1 answer
  • The most important assistance that a full-featured HTML editor provides is _____.
    14·1 answer
  • A database record can best be described as:
    11·1 answer
  • You would like to emphasize certain key terms on a slide with a bold format. Which slide element should you modify to provide th
    15·2 answers
  • As a project manager, why is analysis an important aspect of the job?
    10·1 answer
  • Select the device that will have the most network ports
    8·1 answer
  • 2. Choose all of the correct answers for each of the following: [a] The relations of two sub-entity sets of the same super entit
    6·1 answer
  • A ____ risk assessment evaluates threats to and vulnerabilities of the network.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!