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
Which year marked the arrival of private satellite television channels in India? Answer key - A)1982 B)1985 C)1991 D)1995
Lubov Fominskaja [6]
Up until 1991 there was only 1 public channel
4 0
3 years ago
True or false This html element puts the text in the centre of the webpage. "Something really cool "
Romashka [77]

Answer:

true.

Explanation:

i hope it help u

mark me as brainliest

6 0
3 years ago
What is empowerment technology?
rosijanka [135]
It the use of technological devices such mobile phones and computer devices to help retain and locate information.
3 0
3 years ago
In a C++ program, one and two are double variables and input values are 10.5 and 30.6. After the statement cin &gt;&gt; one &gt;
SSSSS [86.1K]

Answer:

variable one stores 10.5 and two stores 30.6

Explanation:

In c++ language, the cout keyword is used to write to the standard output. The input from the user is taken by using the cin keyword.

For the input from the user, a variable need is declared first.

datatype variable_name;

The input can be taken one at a time as shown.

cin >> variable_name;

The input for more than one variable can be taken in a single line as given by the syntax below.

1. First, two variables are declared.

datatype variable_name1, variable_name2;

2. Both input is taken simultaneously as shown.

cin >> variable_name1, variable_name2;

For the given scenario, two double variables are declared as below.

double one, two;

The question mentions input values for the two double variables as 10.5 and 30.6.

3. The given scenario takes both the values as input at the same time, in a single line as shown below.

cin >> one >> two;

4. After this statement, both the values entered by the user are accepted.

The values should be separated by space.

First value is stored in the variable one.

Second value is stored in the variable two.

5. The user enters the values as follows.

10.5 30.6

6. The value 10.5 is stored in variable one.

7. The value 30.6 is stored in variable two.

The c++ program to implement the above is given below.

#include <iostream>

using namespace std;

int main() {

   double one, two;      

   cout << " Enter two decimal values " << endl;

   cin >> one >> two;

   cout << " The input values are " << endl;

   cout << " one : " << one << " \t " << " two : " << two << endl;

   return 0;

}

OUTPUT

Enter two decimal values  

10.5 30.6

The input values are  

one : 10    two : 530.6

6 0
3 years ago
You learned that properly edited resumes are necessary for making a good impression on a university or a potential employer. Dis
beks73 [17]

Answer:

Resume is the important document for job seekers. As much as the resume is better, there is more chance to grab the job.

If the resume is poor, the employer may not call you for the interview.

Explanation:

Resume is the document that create and impression over the potential employer or university.

If someone have very good hard and soft skills, and does not mention all the skills in resume, then employer could not that skills that you may have. Because your resume is the document that represent you when you are not in front of the employer.  This is the first document, presented that, what  you are and how you are beneficial for the company.

<em>If your resume is poor it may cause that He cannot call you for the interview or not considered for that JOB.</em>

5 0
3 years ago
Read 2 more answers
Other questions:
  • Speech on inventors and inventions
    14·1 answer
  • On an Ethernet, a ____ is broadcast to every device but is accepted only by the device to which it is addressed.
    5·1 answer
  • When entering a formula or function into a cell, most spreadsheet programs require that you begin with some type of symbol, usua
    5·1 answer
  • Easy 25 points answer what is it called that you use only 1 and 0 like this 1010010011001100011110001010010101001010101010010101
    5·1 answer
  • What is a form of a stationary mouse on which the movement of a finger causes the pointer on the screen to move?
    7·1 answer
  • ____________ define the allowable interactions between subjects and objects. credentials responsibilities procedures access cont
    15·2 answers
  • The blank contains the most commonly used commands
    8·1 answer
  • Steps to run a Q-BASIC programme<br>​
    6·1 answer
  • Debugging 2.17.3: Debug: The Two Towers Code Hs
    15·1 answer
  • in which of the following scenarios would a router send a resign message? answer if a preempted active router fails, the standby
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!