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]
1 year 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]1 year 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
What two things should you do before starting the design process
Charra [1.4K]

Answer: B and C

Explanation: Analyze the audience

                      Identify the problem

8 0
2 years ago
After machine language, what is the next most basic type of programming language, which still uses many length strings of numera
solniwko [45]
Basic would be the most basic lanauge. It was created in M.I.T. and was one of the first programming lanauges.
7 0
3 years ago
_____ is a higher-level, object-oriented application interface used to access remote database servers
makkiz [27]
RDO.

RDO uses the lower-level DAO and ODBC for direct access to databases.
7 0
1 year ago
the manager of a xyz organisation is preparing the organizational chart which feature of MS Excel /he will use to do so? also wr
chubhunter [2.5K]

Answer:

Smart Art

Explanation:

The smart art feature in Microsoft excel allows for the creation of organizational chart on Microsoft excel. It readily allows for an hierarchical arrangement of an organization's personnel including the various departments on the system. The smartart allows the implementation of a graphical output which allows the display of an organization's personnel in order of hierarchy. To get started with smart art on excel, Clicking on the insert tab, the same are appears under illustrations. For an organizational chart, the Hierarchy smart art graphic type is selected and filled accordingly.

3 0
2 years ago
What princple of animation is used to animate the movements of the arms of the following character while walking?
Gala2k [10]

Answer:

arc

Explanation:

4 0
3 years ago
Other questions:
  • You can apply several different worksheet themes from which tab?
    11·2 answers
  • Assume that the following code exists inside a method of SomeClass, and that this code compiles without errors:
    13·1 answer
  • Should Gladys call the legal authorities? Which agency should she call?
    9·1 answer
  • What the gas line in the car
    12·1 answer
  • The counter in a for or while loop can have an explicit increment: for i=m:k:n. This advances the counter i by increment k each
    15·1 answer
  • What does it mean if my ninja blender power light is blinking?
    13·2 answers
  • What is a key function of a scrum master plato answer plz
    13·1 answer
  • True or False(T or F): Point-and-shoot cameras have only 1 lens. *
    5·1 answer
  • Create a multimedia project that contains the text element and all the contents that you have studied about that element
    13·1 answer
  • Different Betweens ServerPc And Desktop Pc ~
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!