Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 2 . 1 ( 2 5 % ) partir de la description des r gles de validation et de formatage des ISBN ainsi que
Question
partir de la description des rgles de validation et de formatage des ISBN ainsi que
de la signature de la mthode cidessus, fournissez un plan de test botenoire pour la
mthode tidyISBNorInsertingDashes en utilisant l'approche du partitionnement
en catgories Votre plan de test doit bien montrer les paramtres conditions de
l'environnement, catgories choix et contraintes du problme Rapportez vos
rsultats dans une table suivant le format suivant: Here is the code for the method:
Tidies up an ISBN by first removing stray dashes and
nonnumerics. Validates checksum, checks publisher number, and inserts dashes
where they belong. Discards
whatever it finds before or after the ISBN.
@param rawISBNor rawISBN text to be tidied, possibly with extra dashes,
spaces or other junk chars.
@return tidied dashed ISBN with lead and trail junk discarded. or an error
message if the ISBN is invalid.
public static String tidyISBNorInsertingDashesString rawISBNor
if rawISBNor null rawISBNorlength
throw new IllegalArgumentExceptionno ISBN";
strip lead, trail and embedded junk including dashes
final String dashlessISBN striprawISBNor;
final int length dashlessISBN.length;
switch length
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
case :
ensureISBNValiddashlessISBN;
return insertDashesInISBNordashlessISBN;
default:
throw new IllegalArgumentException
"ISBN must be or digits long.";
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started