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
Systematically tackling the threats and vulnerabilities in the seven individual domains of a typical IT infrastructure helps you
Lorico [155]

Answer:

<u>Organize the roles, responsibilities, and accountabilities for risk management and risk mitigation. </u>

Explanation:

The seven domains in an IT structure can be identified as:

  1. User Domain,
  2. Workstation Domain,
  3. LAN Domain,
  4. WAN LAN Domain,
  5. Remote Access Domain,
  6. WAN Domain,
  7. and System / Application Domain

They can be configured as portals for countermeasure failure and intruders, so it is crucial for organizations to look for ways to protect these domains to prevent unauthorized access to private data.

Therefore the relevance of the systematic approach to threats and vulnerabilities, which will assist in organizing the roles, responsibilities and responsibilities for risk management and mitigation.

7 0
3 years ago
Samantha was calculating a mathematical formula on an electronic spreadsheet. She used multiple values to recalculate the formul
MrMuchimi
B. random-access memory
4 0
3 years ago
Read 2 more answers
How many different integers can be represented with a 4-digit number in base 13?
AnnyKZ [126]
That would be 13^4, or 13*13*13*13 = 28561
6 0
3 years ago
The cell address ZZ123 means
mafiozo [28]
The range of cells from zz1 to zz23
7 0
3 years ago
Read 2 more answers
Using a windows computer, to expand a branch of the folder tree you would _____.
s344n2d4d5 [400]
A folder can include everything from documents and music, to applications [like Word or Excel or your favorite browser]. But computer folders can also contain other folders, lots of them, and those sub-folders can contain folders of their own. This is the called folder tree. The trunk of the tree is the Desktop. Then there are several folders like Recycle Bin, Control Panel,..The most important branch is the one called ‘Libraries’. Here are the Photos, Music, Videos,...
<span>Using a windows computer, to expand a branch of the folder tree you would right click </span>beside various folders and drives to expand the folder tree.

8 0
3 years ago
Other questions:
  • Create a stored procedure named prc_inv_amounts to update the INV_SUBTOTAL, INV_TAX, and INV_TOTAL. The procedure takes the invo
    8·1 answer
  • Using the media as equipment for living. Explain how you would use some form of media to serve a purpose in your life—and what t
    6·2 answers
  • An algorithm is defined as a well-ordered collection of unambiguous and effectively computable operations that when executed pro
    10·1 answer
  • The__ key is used to group or identify a field or record within a table. (you don't need it).
    5·2 answers
  • A snapshot is most similar to which type of backup scheme
    8·1 answer
  • Best app in free to learn python
    7·1 answer
  • What is the capacity of a disk with two platters, 10,000 cylinders, an average of 400 sectors per track, and 512 bytes per secto
    9·1 answer
  • Five technology tools and their uses​
    5·1 answer
  • Using programming libraries is one way of incorporating existing code into new programs.
    15·1 answer
  • a value-returning method must specify as its return type in the method header. question 18 options: a) an int b) a double c) a b
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!