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
riadik2000 [5.3K]
2 years ago
11

write a program that computes an integer's checksum. to compute the checksum, break the integer into its constituent

Computers and Technology
1 answer:
Serggg [28]2 years ago
8 0

Using the knowledge in computational language in python it is possible to write a code that computes an integer's checksum.

<h3>Writting the code:</h3>

<em>def checkSum(n):                    # Function definition</em>

<em>    total = 0                       # total variable which returns sum</em>

<em>    c = 0                           # counter variable which count the even position</em>

<em>    while(n!=0):                    # running a loop while n != 0</em>

<em>        r = int(n%10)               #breaking the number into digits</em>

<em>        c=c+1                       # increase counter</em>

<em>        if c%2==0:                  # if counter is even position then double the number </em>

<em>            r = r*2</em>

<em>            while(r!=0):                            # do the process</em>

<em>                total = total + int(r%10)</em>

<em>                r = int(r/10)</em>

<em>            n=int(n/10)    </em>

<em>        else:                       # if counter is odd position then simple add the digit </em>

<em>            total = total + r       # into total</em>

<em>            n=int(n/10)</em>

<em>    return total                    # in the last return the sum of digits</em>

<em># Driver code</em>

<em>n = int(input("Enter Number:"))         # asking user to enter the number </em>

<em>print(checkSum(n))                      # calling the function</em>

See more about python at brainly.com/question/18502436

#SPJ1

You might be interested in
Type the correct answer in the box. Spell all words correctly. Kenny is designing a document for the employee motivation campaig
Pavel [41]

Answer: The answer is Proximity

Explanation:

6 0
2 years ago
Be able to list a technology-based company and discuss whether it enjoys sustainable competitive advantage based on the resource
aev [14]

Answer:

idk good luck finding one

5 0
3 years ago
Review the given requirements using the checklist and discover possible problems with them. The following requirements are for a
KATRIN_1 [288]

Answer:

Redundancy

Req. 1 and Req. 3 are seemed to say the same thing. We need to remove the first sentence in Req. 1

Conflict and understandability

Req. 1 states that access is through web browser while Req. 4 states that access is via html. We have to re-write the Req. 3 to make it clear that users do not actually have to write directly html to communicate with the system.

Completeness

Req. 5 states that print out will “mainly” be documents. What else might be printed? What other inputs will be produced?

Either remove mainly or clarify other print out.

What version of html or web browser is assumed in Req. 1 and Req. 3?

Explanation:

5 0
4 years ago
Why is color important for all objects drawn ?​
Sati [7]
Technically, drawing in colored pencil is simply layering semitransparent colors on paper to create vivid paintings. Every color has three qualities
7 0
3 years ago
Which of these consoles have 64 bit architecture
tigry1 [53]

I don't know if this is on your list, but I know for a fact that the Nintendo 64 system (or N64) has a 64-bit architecture.

8 0
3 years ago
Other questions:
  • Carlos owns a hardware store. He currently is not using any software to track what he has in the store. In one to two sentences,
    9·2 answers
  • Plz answer and dont put a random thing for the points
    11·1 answer
  • To configure a router / modem, what type of IP interface configuration should you apply to the computer you are using?
    8·1 answer
  • This LEGENDARY character made a much-celebrated comeback in 2017. What was the name of the villain he faced in this epic tale?
    7·2 answers
  • Which of the following is generally nota desire today's workers? A. computer ability B willingness to learn C. teamwork skills D
    8·1 answer
  • Utility software is also known as _____​
    11·1 answer
  • Which of these is one of the primary concerns for protecting your family when online?
    9·2 answers
  • Who distributes IP Address?
    10·1 answer
  • I will give brainliest!!!
    13·1 answer
  • If a filesystem has a block size of 4096 bytes, this means that a file comprised of only one byte will still use 4096 bytes of s
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!