subject

/*(Business: check ISBN-10) An ISBN-10 (International Standard Book Number)consists of 10 digits: d1d2d3d4d5d6d7d8d9d10. The last digit, d10, is a checksum, which is calculated from the other nine digits using the following formula:(d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 +d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9) % 11If the checksum is 10, the last digit is denoted as X according to the ISBN-10convention. Write a program that prompts the user to enter the first 9 digits anddisplays the 10-digit ISBN (including leading zeros). Your program should readthe input as an integer. Here are sample runs:*/import java. util. Scanner;public class Exercise_03_09 { public static void main(String[] args) { Scanner input = new Scanner(System. in); // Prompt the user to enter the first 9 digits of a 10-digit ISBN System. out. print("Enter the first 9 digits of an ISBN as integer: "); int isbn = input. nextInt(); // Extract the digits of the ISBN int d1 = isbn / 100000000; int remainingDigits = isbn % 100000000; int d2 = remainingDigits / 10000000; remainingDigits %= 10000000; int d3 = remainingDigits / 1000000; remainingDigits %= 1000000; int d4 = remainingDigits / 100000; remainingDigits %= 100000; int d5 = remainingDigits / 10000; remainingDigits %= 10000; int d6 = remainingDigits / 1000; remainingDigits %= 1000; int d7 = remainingDigits / 100; remainingDigits %= 100; int d8 = remainingDigits / 10; remainingDigits %= 10; int d9 = remainingDigits; // Compute d10 int d10 = (d1 * 1 + d2 * 2 + d3 * 3 + d4 * 4 + d5 * 5 + d6 * 6 + d7 * 7 + d8 * 8 + d9 * 9) % 11; // Display the 10-digit ISBN System. out. println("The ISBN-10 number is " + d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9); if (d10 == 10) System. out. println("X"); else System. out. println(d10); }}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
What must you do before formatting a paragraph?
Answers: 1
question
Computers and Technology, 21.06.2019 22:20
This problem has been solved! see the answeran evil king has a cellar containing n bottles of expensive wine, and his guards have just caught a spy trying to poison the king’s wine. fortunately, the guards caught the spy after he succeeded in poisoning only one bottle. unfortunately, they don’t know which one. to make matters worse, the poison the spy used was very deadly; just one drop diluted even a billion to one will still kill someone. even so, the poison works slowly; it takes a full month for the person to die. design a scheme that allows the evil king to determine exactly which one of his wine bottles was poisoned in just one month’s time while expending at most o(logn) of his taste testers.you are not allowed to use n testers, one for each bottle, and see which one tester dies after 30 days.(no pseudocode needed. just answer in words, how many testers you use, how you use them and why you correctly identify the poisoned bottle in 30 days)
Answers: 2
question
Computers and Technology, 23.06.2019 18:30
This program should be a short piece of code that prints all of the positive integers from 1 to 100 as described more fully below. the program may contain multiple methods, and if using an oo language, should be contained within a single class or object. the program should be designed so that it begins execution when invoked through whichever mechanism is most common for the implementation language. â–ş print out all positive integers from 1 to 100, inclusive and in order. â–ş print messages to standard output, matching the sample output below. â–ş in the output, state whether the each integer is 'odd' or 'even' in the output. â–ş if the number is divisible by three, instead of stating that the number is odd or even, state that the number is 'divisible by three'. â–ş if the number is divisible by both two and three, instead of saying that the number is odd, even or divisible by three; state that the number is 'divisible by two and three'. â–ş design the logic of the loop to be as efficient as possible, using the minimal number of operations to perform the required logic. sample output the number '1' is odd. the number '2' is even. the number '3' is divisible by three. the number '6' is divisible by two and three.
Answers: 1
question
Computers and Technology, 24.06.2019 09:10
  to change the number of rows and columns displayed by the excel object a. select the object and drag a size handle on the active object. b. deselect the object and drag a size handle of the object. c. deselect the object and drag a row or column divider of the object. d. select the object and drag a row or column divider on the active object.
Answers: 2
You know the right answer?
/*(Business: check ISBN-10) An ISBN-10 (International Standard Book Number)consists of 10 digits: d1...
Questions
question
Mathematics, 16.09.2020 14:01
question
English, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Spanish, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
English, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Spanish, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
question
Mathematics, 16.09.2020 14:01
Questions on the website: 13722367