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 22:00
When slick heating company switched to an activity based costing system, it realized that it was allocating a much lower percentage of factory overhead to a product line that the marketing department was trying to push. the product line may contain which type of products?
Answers: 2
question
Business, 22.06.2019 02:00
Jamie lee is reviewing her finances one month later. she has provided the actual amounts paid below. use the cash budget table below to her identify the variances in her budget. each answer must have a value for the assignment to be complete. enter "0" for any unused categories. actual amounts income: monthly expenses: gross monthly salary $2,315 rent obligation $260 net monthly salary $1,740 utilities/electricity $130 savings allocation: utilities/water $10 regular savings $130 utilities/cable tv $155 rainy-day savings $20 food $160 entertainment: gas/maintenance $205 cake decorating class $90 credit card payment $25 movies with friends $50 car insurance $75 clothing $145 budgeted amounts assets: monthly expenses: checking account $1,850 rent obligation $225 emergency fund savings account $4,300 utilities/electricity $75 car $5,200 utilities/water $35 computer & ipad $1,100 utilities/cable tv $120 liabilities: food $115 student loan $6,600 gas/maintenance $95 credit card balance $1,000 credit card payment $45 income: car insurance $45 gross monthly salary $2,155 clothing $45 net monthly salary $1,580 entertainment: savings allocation: cake decorating class $90 regular savings $130 movies with friends $50 rainy day savings $20
Answers: 2
question
Business, 22.06.2019 04:00
Match the type of agreements to their descriptions. will trust living will prenuptial agreement
Answers: 2
question
Business, 22.06.2019 19:50
Ichelle is attending college and has a part-time job. once she finishes college, michelle would like to relocate to a metropolitan area. she wants to build her savings so that she will have a "nest egg" to start her off. michelle works out her budget and decides she can afford to set aside $9090 per month for savings. her bank will pay her 4 %4% per year, compounded monthly, on her savings account. what will be michelle's balance in five years?
Answers: 3
You know the right answer?
I'm attempting to do this problem
[ISBN checksum (10 points). Write a program ISBNChecksum. ja...
Questions
Questions on the website: 13722367