SlideShare uma empresa Scribd logo
1 de 2
Baixar para ler offline
/** Checks whether a given string is a palindrome or not.
*
*@param inputString the string to check for palindrome
*@param ignoreCase a flag to indicate whether case should be ignored when checking for
palindrome
*@return true if the input string is a palindrome, false otherwise
*@throws IllegalArguementException if the input string is null
*
*Example:
*isPalindrome("racecar", true);//returns true
*isPalindrome("Racecar", true); //returns true
*isPalindrome("hello", true); // returns false
*
*/
public static boolean isPalindrome(String inputString, boolean ignoreCase) {
if (inputString == null) {
throw new IllegalArguementException("Input string cannot be null.");
}
int leftIndex = 0;
int rightIndex = inputString.length() -1;
while (leftIndex < rightIndex) {
if (inputString.charAt(leftIndex) != inputString.charAt(rightIndex)) {
return false;
}
leftIndex++;
rightIndex--;
}
return true;
}
Based on the code, answer the following questions: please!
1. Draw the control flow graph that represents abstraction of its execution. Label edges and
nodes in the graph with the corresponding code fragments. (15 points)
Hint-1: Do not forget to indicate initial and end node(s).
Hint-2: You do not need to create a node for the method declaration part in the first line
2. List the test requirements for Node Coverage(3 points)
3. Identify test paths that achieve the test requirements for Node Coverage
4. Give a set of test cases for the test paths in c. Make sure to include test input values and
expected outputs. If it is impossible to design a test case for any test requirements, briefly discuss
why.
5. List the test requirements for Edge Coverage
6.Identify test paths that achieve the test requirements for Edge Coverage
7. Give a set of test cases for the test paths in f. Make sure to include test input values and
expected outputs. If it is impossible to design a test case for any test requirements, briefly discuss
why.

Mais conteúdo relacionado

Semelhante a Checks whether a given string is a palindrome or not. @pa.pdf

JavaScript Qualitätssicherung
JavaScript QualitätssicherungJavaScript Qualitätssicherung
JavaScript QualitätssicherungSebastian Springer
 
#include iostream #include string#includeiomanip using.docx
#include iostream #include string#includeiomanip using.docx#include iostream #include string#includeiomanip using.docx
#include iostream #include string#includeiomanip using.docxajoy21
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingKeshav Kumar
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingKeshav Kumar
 
Analysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsAnalysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsPVS-Studio
 
DotNet programming & Practices
DotNet programming & PracticesDotNet programming & Practices
DotNet programming & PracticesDev Raj Gautam
 
Lecture 15_Strings and Dynamic Memory Allocation.pptx
Lecture 15_Strings and  Dynamic Memory Allocation.pptxLecture 15_Strings and  Dynamic Memory Allocation.pptx
Lecture 15_Strings and Dynamic Memory Allocation.pptxJawadTanvir
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type PatternsSimon Ritter
 
I am working on java programming that converts zipcode to barcode an.pdf
I am working on java programming that converts zipcode to barcode an.pdfI am working on java programming that converts zipcode to barcode an.pdf
I am working on java programming that converts zipcode to barcode an.pdfthangarajarivukadal
 
CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptSanjjaayyy
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil Witecki
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programmingnmahi96
 
Csharp In Detail Part2
Csharp In Detail Part2Csharp In Detail Part2
Csharp In Detail Part2Mohamed Krar
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxpriestmanmable
 

Semelhante a Checks whether a given string is a palindrome or not. @pa.pdf (20)

11.ppt
11.ppt11.ppt
11.ppt
 
C++ boot camp part 1/2
C++ boot camp part 1/2C++ boot camp part 1/2
C++ boot camp part 1/2
 
C++ Boot Camp Part 1
C++ Boot Camp Part 1C++ Boot Camp Part 1
C++ Boot Camp Part 1
 
JavaScript Qualitätssicherung
JavaScript QualitätssicherungJavaScript Qualitätssicherung
JavaScript Qualitätssicherung
 
#include iostream #include string#includeiomanip using.docx
#include iostream #include string#includeiomanip using.docx#include iostream #include string#includeiomanip using.docx
#include iostream #include string#includeiomanip using.docx
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programming
 
JAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programmingJAVA Tutorial- Do's and Don'ts of Java programming
JAVA Tutorial- Do's and Don'ts of Java programming
 
Go testdeep
Go testdeepGo testdeep
Go testdeep
 
Analysis of Microsoft Code Contracts
Analysis of Microsoft Code ContractsAnalysis of Microsoft Code Contracts
Analysis of Microsoft Code Contracts
 
DotNet programming & Practices
DotNet programming & PracticesDotNet programming & Practices
DotNet programming & Practices
 
Lecture 15_Strings and Dynamic Memory Allocation.pptx
Lecture 15_Strings and  Dynamic Memory Allocation.pptxLecture 15_Strings and  Dynamic Memory Allocation.pptx
Lecture 15_Strings and Dynamic Memory Allocation.pptx
 
Java Puzzlers
Java PuzzlersJava Puzzlers
Java Puzzlers
 
The Art of Java Type Patterns
The Art of Java Type PatternsThe Art of Java Type Patterns
The Art of Java Type Patterns
 
I am working on java programming that converts zipcode to barcode an.pdf
I am working on java programming that converts zipcode to barcode an.pdfI am working on java programming that converts zipcode to barcode an.pdf
I am working on java programming that converts zipcode to barcode an.pdf
 
CONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.pptCONTROLSTRUCTURES.ppt
CONTROLSTRUCTURES.ppt
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
C programming
C programmingC programming
C programming
 
Control statements-Computer programming
Control statements-Computer programmingControl statements-Computer programming
Control statements-Computer programming
 
Csharp In Detail Part2
Csharp In Detail Part2Csharp In Detail Part2
Csharp In Detail Part2
 
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docxjava compilerCompiler1.javajava compilerCompiler1.javaimport.docx
java compilerCompiler1.javajava compilerCompiler1.javaimport.docx
 

Mais de stexfitness

Current Attempt in Progress F Your answer is partially correct. The f.pdf
 Current Attempt in Progress F Your answer is partially correct. The f.pdf Current Attempt in Progress F Your answer is partially correct. The f.pdf
Current Attempt in Progress F Your answer is partially correct. The f.pdfstexfitness
 
Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf
 Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf
Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdfstexfitness
 
Create a class to represent a Infant object that inherits from (exten.pdf
 Create a class to represent a Infant object that inherits from (exten.pdf Create a class to represent a Infant object that inherits from (exten.pdf
Create a class to represent a Infant object that inherits from (exten.pdfstexfitness
 
crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf
 crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf
crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdfstexfitness
 
Crane Company had the following stockholders equity as of January 1,.pdf
 Crane Company had the following stockholders equity as of January 1,.pdf Crane Company had the following stockholders equity as of January 1,.pdf
Crane Company had the following stockholders equity as of January 1,.pdfstexfitness
 
Convad Company is one of the worlds leading com refiners. It pro.pdf
 Convad Company is one of the worlds leading com refiners. It pro.pdf Convad Company is one of the worlds leading com refiners. It pro.pdf
Convad Company is one of the worlds leading com refiners. It pro.pdfstexfitness
 
Contemporary issues in managing dark heritage include i. interpretati.pdf
 Contemporary issues in managing dark heritage include i. interpretati.pdf Contemporary issues in managing dark heritage include i. interpretati.pdf
Contemporary issues in managing dark heritage include i. interpretati.pdfstexfitness
 
Consider two countries, the Portugal and Spain, that each produce onl.pdf
 Consider two countries, the Portugal and Spain, that each produce onl.pdf Consider two countries, the Portugal and Spain, that each produce onl.pdf
Consider two countries, the Portugal and Spain, that each produce onl.pdfstexfitness
 
Consider the relative liquidity of the following assets Assets 1. A$.pdf
 Consider the relative liquidity of the following assets Assets 1. A$.pdf Consider the relative liquidity of the following assets Assets 1. A$.pdf
Consider the relative liquidity of the following assets Assets 1. A$.pdfstexfitness
 
Consider the Poisson probability distribution with =12.6. Determine t.pdf
 Consider the Poisson probability distribution with =12.6. Determine t.pdf Consider the Poisson probability distribution with =12.6. Determine t.pdf
Consider the Poisson probability distribution with =12.6. Determine t.pdfstexfitness
 
Consider the forwarding table below. Indicate the link interface to w.pdf
 Consider the forwarding table below. Indicate the link interface to w.pdf Consider the forwarding table below. Indicate the link interface to w.pdf
Consider the forwarding table below. Indicate the link interface to w.pdfstexfitness
 
Consider the following premerger information about Firm X and Firm Y .pdf
 Consider the following premerger information about Firm X and Firm Y .pdf Consider the following premerger information about Firm X and Firm Y .pdf
Consider the following premerger information about Firm X and Firm Y .pdfstexfitness
 
Consider the following simplified version of the RSA algorithm for pu.pdf
 Consider the following simplified version of the RSA algorithm for pu.pdf Consider the following simplified version of the RSA algorithm for pu.pdf
Consider the following simplified version of the RSA algorithm for pu.pdfstexfitness
 
Consider the following supply and demand model of good i in region jQ.pdf
 Consider the following supply and demand model of good i in region jQ.pdf Consider the following supply and demand model of good i in region jQ.pdf
Consider the following supply and demand model of good i in region jQ.pdfstexfitness
 
Consider the following income statement for the Luna Lighting Company.pdf
 Consider the following income statement for the Luna Lighting Company.pdf Consider the following income statement for the Luna Lighting Company.pdf
Consider the following income statement for the Luna Lighting Company.pdfstexfitness
 
Consider the following a) $20 billion in Canada Savings bonds are in.pdf
 Consider the following a) $20 billion in Canada Savings bonds are in.pdf Consider the following a) $20 billion in Canada Savings bonds are in.pdf
Consider the following a) $20 billion in Canada Savings bonds are in.pdfstexfitness
 
Consider the following joint distribution of random va a. Find PX(x.pdf
 Consider the following joint distribution of random va a. Find PX(x.pdf Consider the following joint distribution of random va a. Find PX(x.pdf
Consider the following joint distribution of random va a. Find PX(x.pdfstexfitness
 
Concord Corporation had 606000 sheres of common stock outitanding on .pdf
 Concord Corporation had 606000 sheres of common stock outitanding on .pdf Concord Corporation had 606000 sheres of common stock outitanding on .pdf
Concord Corporation had 606000 sheres of common stock outitanding on .pdfstexfitness
 
Consider the discrete random variables X1 and X2 with joint probabili.pdf
 Consider the discrete random variables X1 and X2 with joint probabili.pdf Consider the discrete random variables X1 and X2 with joint probabili.pdf
Consider the discrete random variables X1 and X2 with joint probabili.pdfstexfitness
 
Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf
 Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf
Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdfstexfitness
 

Mais de stexfitness (20)

Current Attempt in Progress F Your answer is partially correct. The f.pdf
 Current Attempt in Progress F Your answer is partially correct. The f.pdf Current Attempt in Progress F Your answer is partially correct. The f.pdf
Current Attempt in Progress F Your answer is partially correct. The f.pdf
 
Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf
 Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf
Crossing of two bacteriophages with mutations such as T4 rapid lysis .pdf
 
Create a class to represent a Infant object that inherits from (exten.pdf
 Create a class to represent a Infant object that inherits from (exten.pdf Create a class to represent a Infant object that inherits from (exten.pdf
Create a class to represent a Infant object that inherits from (exten.pdf
 
crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf
 crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf
crah to Morithy Cadh Fixpenies lutio Feet cash fiomes from ooeraing a.pdf
 
Crane Company had the following stockholders equity as of January 1,.pdf
 Crane Company had the following stockholders equity as of January 1,.pdf Crane Company had the following stockholders equity as of January 1,.pdf
Crane Company had the following stockholders equity as of January 1,.pdf
 
Convad Company is one of the worlds leading com refiners. It pro.pdf
 Convad Company is one of the worlds leading com refiners. It pro.pdf Convad Company is one of the worlds leading com refiners. It pro.pdf
Convad Company is one of the worlds leading com refiners. It pro.pdf
 
Contemporary issues in managing dark heritage include i. interpretati.pdf
 Contemporary issues in managing dark heritage include i. interpretati.pdf Contemporary issues in managing dark heritage include i. interpretati.pdf
Contemporary issues in managing dark heritage include i. interpretati.pdf
 
Consider two countries, the Portugal and Spain, that each produce onl.pdf
 Consider two countries, the Portugal and Spain, that each produce onl.pdf Consider two countries, the Portugal and Spain, that each produce onl.pdf
Consider two countries, the Portugal and Spain, that each produce onl.pdf
 
Consider the relative liquidity of the following assets Assets 1. A$.pdf
 Consider the relative liquidity of the following assets Assets 1. A$.pdf Consider the relative liquidity of the following assets Assets 1. A$.pdf
Consider the relative liquidity of the following assets Assets 1. A$.pdf
 
Consider the Poisson probability distribution with =12.6. Determine t.pdf
 Consider the Poisson probability distribution with =12.6. Determine t.pdf Consider the Poisson probability distribution with =12.6. Determine t.pdf
Consider the Poisson probability distribution with =12.6. Determine t.pdf
 
Consider the forwarding table below. Indicate the link interface to w.pdf
 Consider the forwarding table below. Indicate the link interface to w.pdf Consider the forwarding table below. Indicate the link interface to w.pdf
Consider the forwarding table below. Indicate the link interface to w.pdf
 
Consider the following premerger information about Firm X and Firm Y .pdf
 Consider the following premerger information about Firm X and Firm Y .pdf Consider the following premerger information about Firm X and Firm Y .pdf
Consider the following premerger information about Firm X and Firm Y .pdf
 
Consider the following simplified version of the RSA algorithm for pu.pdf
 Consider the following simplified version of the RSA algorithm for pu.pdf Consider the following simplified version of the RSA algorithm for pu.pdf
Consider the following simplified version of the RSA algorithm for pu.pdf
 
Consider the following supply and demand model of good i in region jQ.pdf
 Consider the following supply and demand model of good i in region jQ.pdf Consider the following supply and demand model of good i in region jQ.pdf
Consider the following supply and demand model of good i in region jQ.pdf
 
Consider the following income statement for the Luna Lighting Company.pdf
 Consider the following income statement for the Luna Lighting Company.pdf Consider the following income statement for the Luna Lighting Company.pdf
Consider the following income statement for the Luna Lighting Company.pdf
 
Consider the following a) $20 billion in Canada Savings bonds are in.pdf
 Consider the following a) $20 billion in Canada Savings bonds are in.pdf Consider the following a) $20 billion in Canada Savings bonds are in.pdf
Consider the following a) $20 billion in Canada Savings bonds are in.pdf
 
Consider the following joint distribution of random va a. Find PX(x.pdf
 Consider the following joint distribution of random va a. Find PX(x.pdf Consider the following joint distribution of random va a. Find PX(x.pdf
Consider the following joint distribution of random va a. Find PX(x.pdf
 
Concord Corporation had 606000 sheres of common stock outitanding on .pdf
 Concord Corporation had 606000 sheres of common stock outitanding on .pdf Concord Corporation had 606000 sheres of common stock outitanding on .pdf
Concord Corporation had 606000 sheres of common stock outitanding on .pdf
 
Consider the discrete random variables X1 and X2 with joint probabili.pdf
 Consider the discrete random variables X1 and X2 with joint probabili.pdf Consider the discrete random variables X1 and X2 with joint probabili.pdf
Consider the discrete random variables X1 and X2 with joint probabili.pdf
 
Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf
 Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf
Con sede en Clichy, Francia, a las afueras de Par�s, LOr�al es l.pdf
 

Último

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmStan Meyer
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONHumphrey A Beña
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxRosabel UA
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfErwinPantujan2
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationRosabel UA
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSMae Pangan
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Projectjordimapav
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4JOYLYNSAMANIEGO
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operationalssuser3e220a
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designMIPLM
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsRommel Regala
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxlancelewisportillo
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxJanEmmanBrigoli
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management systemChristalin Nelson
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxruthvilladarez
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptxmary850239
 

Último (20)

Oppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and FilmOppenheimer Film Discussion for Philosophy and Film
Oppenheimer Film Discussion for Philosophy and Film
 
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATIONTHEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
THEORIES OF ORGANIZATION-PUBLIC ADMINISTRATION
 
Presentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptxPresentation Activity 2. Unit 3 transv.pptx
Presentation Activity 2. Unit 3 transv.pptx
 
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdfVirtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
Virtual-Orientation-on-the-Administration-of-NATG12-NATG6-and-ELLNA.pdf
 
Activity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translationActivity 2-unit 2-update 2024. English translation
Activity 2-unit 2-update 2024. English translation
 
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptxFINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
FINALS_OF_LEFT_ON_C'N_EL_DORADO_2024.pptx
 
Textual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHSTextual Evidence in Reading and Writing of SHS
Textual Evidence in Reading and Writing of SHS
 
ClimART Action | eTwinning Project
ClimART Action    |    eTwinning ProjectClimART Action    |    eTwinning Project
ClimART Action | eTwinning Project
 
Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4Daily Lesson Plan in Mathematics Quarter 4
Daily Lesson Plan in Mathematics Quarter 4
 
Expanded definition: technical and operational
Expanded definition: technical and operationalExpanded definition: technical and operational
Expanded definition: technical and operational
 
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptxINCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
INCLUSIVE EDUCATION PRACTICES FOR TEACHERS AND TRAINERS.pptx
 
Keynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-designKeynote by Prof. Wurzer at Nordex about IP-design
Keynote by Prof. Wurzer at Nordex about IP-design
 
The Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World PoliticsThe Contemporary World: The Globalization of World Politics
The Contemporary World: The Globalization of World Politics
 
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptxQ4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
Q4-PPT-Music9_Lesson-1-Romantic-Opera.pptx
 
Millenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptxMillenials and Fillennials (Ethical Challenge and Responses).pptx
Millenials and Fillennials (Ethical Challenge and Responses).pptx
 
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptxYOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
YOUVE GOT EMAIL_FINALS_EL_DORADO_2024.pptx
 
Concurrency Control in Database Management system
Concurrency Control in Database Management systemConcurrency Control in Database Management system
Concurrency Control in Database Management system
 
Paradigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTAParadigm shift in nursing research by RS MEHTA
Paradigm shift in nursing research by RS MEHTA
 
TEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docxTEACHER REFLECTION FORM (NEW SET........).docx
TEACHER REFLECTION FORM (NEW SET........).docx
 
4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx4.16.24 21st Century Movements for Black Lives.pptx
4.16.24 21st Century Movements for Black Lives.pptx
 

Checks whether a given string is a palindrome or not. @pa.pdf

  • 1. /** Checks whether a given string is a palindrome or not. * *@param inputString the string to check for palindrome *@param ignoreCase a flag to indicate whether case should be ignored when checking for palindrome *@return true if the input string is a palindrome, false otherwise *@throws IllegalArguementException if the input string is null * *Example: *isPalindrome("racecar", true);//returns true *isPalindrome("Racecar", true); //returns true *isPalindrome("hello", true); // returns false * */ public static boolean isPalindrome(String inputString, boolean ignoreCase) { if (inputString == null) { throw new IllegalArguementException("Input string cannot be null."); } int leftIndex = 0; int rightIndex = inputString.length() -1; while (leftIndex < rightIndex) { if (inputString.charAt(leftIndex) != inputString.charAt(rightIndex)) { return false; } leftIndex++; rightIndex--; } return true; } Based on the code, answer the following questions: please! 1. Draw the control flow graph that represents abstraction of its execution. Label edges and nodes in the graph with the corresponding code fragments. (15 points)
  • 2. Hint-1: Do not forget to indicate initial and end node(s). Hint-2: You do not need to create a node for the method declaration part in the first line 2. List the test requirements for Node Coverage(3 points) 3. Identify test paths that achieve the test requirements for Node Coverage 4. Give a set of test cases for the test paths in c. Make sure to include test input values and expected outputs. If it is impossible to design a test case for any test requirements, briefly discuss why. 5. List the test requirements for Edge Coverage 6.Identify test paths that achieve the test requirements for Edge Coverage 7. Give a set of test cases for the test paths in f. Make sure to include test input values and expected outputs. If it is impossible to design a test case for any test requirements, briefly discuss why.