subject
Business, 22.02.2020 22:05 shawnplayzsavage

I'm attempting to do this problem
[ISBN checksum (10 points). 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:
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.]

And So far have this,

public static void main (String[] args) {

int ISBN = Integer. parseInt(args[0]);
int TotalSum = Integer. parseInt(args[1]);
int Count = Integer. parseInt(args[2]);
int NumRemainder = Integer. parseInt(args[3]);
int CheckSum = Integer. parseInt(args[4]);
int IncrementVariable = Integer. parseInt(args[5]);

TotalSum = 0;
IncrementVariable = 2;
Count = 1;
NumRemainder = 0;
CheckSum = 0;

while (Count < 10);{
NumRemainder = ISBN%10;
CheckSum = NumRemainder * IncrementVariable;
TotalSum = CheckSum + TotalSum;
ISBN = ISBN / 10;
IncrementVariable += 1;
Count += 1;
}
NumRemainder = TotalSum % 11;
if (NumRemainder == 0){
CheckSum = 0;}
else if (NumRemainder == 10){
CheckSum = 'X';
System. out. println(CheckSum);
}
else if (NumRemainder >= 1 && NumRemainder <= 9){
CheckSum = 11 - NumRemainder;
System. out. println(CheckSum);}
else {
System. out. println(CheckSum);
}

}
}

can someone please give me pointers on what I'm doing wrong?
Thanks

ansver
Answers: 1

Another question on Business

question
Business, 21.06.2019 18:30
What is product differentiation, and how can it be achieved ? what is product positioning? what conditions would head to head product positioning be appropriate?
Answers: 2
question
Business, 22.06.2019 17:50
What additional information about the numbers used to compute this ratio might be useful in you assess liquidity? (select all that apply) (a) the maturity schedule of current liabilities (b) the average stock price for the industry (c) the average current ratio for the industry (d) the amount of current assets that is concentrated in relatively illiquid inventories
Answers: 3
question
Business, 22.06.2019 19:00
When making broccoli cream soup, the broccoli and aromatics should be a. burned. b. simmered. c. puréed. d. sweated.
Answers: 2
question
Business, 22.06.2019 22:00
Anheuser-busch inbev is considering you for an entry-level brand management position. you have been asked to prepare an analysis of the u.s. craft beer industry as part of the selection process. prepare a 3-5 page report that includes a description of the industry’s strategically relevant macro-environmental components, evaluates competition in the industry, assesses drivers of change and industry dynamics, and lists industry key success factors. the company’s management also asks that you propose the basic elements of a strategic action plan that will allow the company to improve its competitive position in the market for craft beer. you must provide a heading in your report for each of the required elements of the assignment.
Answers: 3
You know the right answer?
I'm attempting to do this problem
[ISBN checksum (10 points). Write a program ISBNChecksum. ja...
Questions
question
Computers and Technology, 12.07.2019 12:30
Questions on the website: 13722363