Computers and Technology

Write a program ISBNChecksum. java that takes a 9-digit int as a command-line argument and displays the checksum digit according to the following rules: (IN JAVA PLEASE)

Multiply the first digit by 10, the second by 9, the third by 8, and so on, down to the ninth digit by 2.
Add the values together.
Divide the sum by 11. What is the remainder?
If the remainder is 0, the checksum is 0; otherwise, subtract the remainder from 11 to get the checksum digit.
If the checksum that you come up with is 10, then X is used as the checksum digit!

As an example, the checksum digit corresponding to 020131452 is 5 since 5 is the only value of x between 0 and 10 for which10*0 + 9*2 + 8*0 + 7*1 + 6*3 + 5*1 + 4*4 + 3*5 + 2*2 + 1*x is a multiple of 11.

Hint 1: to extract the rightmost digit of a number use the modulus operator.
Hint 2: to remove the rightmost digit of a number use the integer division by 10
Hint 3: for full credit use a loop to compute the sum

Assume the input value used to test your program is a 9-digit positive integer. Also assume that the input is a valid ISBN number without the checksum digit.

answer
Answers: 3

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, ibrahimuskalel
Avariable definition defines the name of a variable that will be used in a program, as well as
Answers: 3
image
Computers and Technology, 23.06.2019 00:30, vane3152
If joey was single and his taxable income was $9,500, how much would he pay in taxes each year?
Answers: 1
image
Computers and Technology, 23.06.2019 18:00, joybeth9591
What can a word user do with the customize ribbon dialog box? check all that apply. minimize the ribbon add a new tab to the ribbon remove a group from a tab add a group to a tab choose which styles appear choose which fonts appear choose tools to appear in a group
Answers: 1
image
Computers and Technology, 24.06.2019 10:20, Cobetate
Multiple choice project create a program with two multiple choice questions. 1. users have two attempts only, show attempt number each time. hint: while loop with break control. (20%) 2. only one correct answer for each question, use switch case for each question. (20%) 3. show total score after the two questions are answered. hint: . (20%) 4. user have options to answer the two questions again if first attempt score is not 100%. hint: if statment. (20%) 5. use string method .toupper() to allow users to enter with lowercase or uppercase letters. (20%) 1. where is the capital of the state of florida? a. orlando b. tallahassee c. miami d. tampa b 2. where is walt disney world park located in florida? a. orlando b. tallahassee c. miami d. tampa a
Answers: 1
Do you know the correct answer?
Write a program ISBNChecksum. java that takes a 9-digit int as a command-line argument and displays...

Questions in other subjects:

Konu
Mathematics, 05.02.2021 08:00
Konu
Mathematics, 05.02.2021 08:00
Konu
Mathematics, 05.02.2021 08:00
Konu
Computers and Technology, 05.02.2021 08:00