Docsity

Java Quiz: Writing a Palindrome Checking Method, Quizzes of Computer Science

Toggle sidebar
bg1
CMSC131 Fall 2004 Quiz #5, Duration 20 Minutes
First Name:
Last Name:
Student Id:
Section time (10am/11am): TAs:
Problem Description
Write a static Java method called palindrome that returns true if a character array represents a
palindrome and false otherwise. A palindrome is a word that reads the same backwards as forwards. For
example, the following words are considered palindromes:
racecar mom
The palindrome method is a public static method with boolean as return type and with a character array
(char[] word) as parameter. You do not need to provide a class declaration or a main method, just the
method.
WRITE YOUR IMPLEMENTATION ON THE NEXT PAGE
pf3

Partial preview of the text

Download Java Quiz: Writing a Palindrome Checking Method and more Quizzes Computer Science in PDF only on Docsity!

CMSC131 Fall 2004 Quiz #5, Duration 20 Minutes

First Name: Last Name: Student Id: Section time (10am/11am): TAs:

Problem Description

Write a static Java method called palindrome that returns true if a character array represents a palindrome and false otherwise. A palindrome is a word that reads the same backwards as forwards. For example, the following words are considered palindromes:

racecar mom

The palindrome method is a public static method with boolean as return type and with a character array (char[] word) as parameter. You do not need to provide a class declaration or a main method, just the method.

WRITE YOUR IMPLEMENTATION ON THE NEXT PAGE