Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

* Make the following changes to the CheckISBN program: a) If the user\'s input i

ID: 3608816 • Letter: #

Question

* Make the following changes to the CheckISBN program: a) If the user's input is not 13 characters long or does notcontain exactly three dashes, have the program prompt the user tore-enter the input. The program will repeat the prompt as often asnecessary until the input meets these criteria.
b) Use a loop to calculate the value of the totalvariable.
c) Instead of printing the original check digit and thecomputed check digit, have the program display either ISBN is valid(if the check digits match) or ISBN is not valid (if theydon't). a) If the user's input is not 13 characters long or does notcontain exactly three dashes, have the program prompt the user tore-enter the input. The program will repeat the prompt as often asnecessary until the input meets these criteria.
b) Use a loop to calculate the value of the totalvariable.
c) Instead of printing the original check digit and thecomputed check digit, have the program display either ISBN is valid(if the check digits match) or ISBN is not valid (if theydon't).

Explanation / Answer

please rate - thanks this is the best I could do - I don't think that is the correctdefinition of how to calculate the ISBN import jpb.*; public class CheckISBN { public static void main (String[] args){ int dashPos1,dashPos2,dashPos3; String originalISBN; boolean error; do {error=true; SimpleIO.prompt("Enter ISBN:"); String originalISBN = SimpleIO.readLine(); dashPos1 = originalISBN.indexOf("-"); dashPos2 = originalISBN.indexOf("-", dashPos1 + 1); dashPos3 = originalISBN.indexOf("-", dashPos2 + 1); if(dashPos3>12||originalISBN.length()!=13)     {error=false;       System.out.println("Illegal input");       } }while(!error); String reducedISBN = originalISBN.substring(0, dashPos1)+ originalISBN.substring(dashPos1 + 1, dashPos2) + originalISBN.substring(dashPos2 + 1,dashPos3)+ originalISBN.substring(dashPos3 + 1,12); int total=0; for(int i=0;i