Answered step by step
Verified Expert Solution
Link Copied!

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 2.1(25%)
partir de la description des rgles de validation et de formatage des ISBN ainsi que
de la signature de la mthode ci-dessus, fournissez un plan de test bote-noire pour la
mthode tidyISBN10or13InsertingDashes 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
* non-numerics. Validates checksum, checks publisher number, and inserts dashes
* where they belong. Discards
* whatever it finds before or after the ISBN.
*
* @param rawISBN10or13 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 tidyISBN10or13InsertingDashes(String rawISBN10or13){
if (rawISBN10or13== null || rawISBN10or13.length()==0){
throw new IllegalArgumentException("no ISBN");
}
// strip lead, trail and embedded junk including dashes
final String dashlessISBN = strip(rawISBN10or13);
final int length = dashlessISBN.length();
switch (length){
case 10:
ensureISBN10Valid(dashlessISBN);
return insertDashesInISBN10or13(dashlessISBN);
case 13:
ensureISBN13Valid(dashlessISBN);
return insertDashesInISBN10or13(dashlessISBN);
default:
throw new IllegalArgumentException(
"ISBN must be 10 or 13 digits long.");
}
}
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Evaluate the exponents:AppendixLO1 a. 2 23 b. 5

Answered: 1 week ago

Question

Be prepared to address excessive absenteeism

Answered: 1 week ago