Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

CSE360 Assignment 1 No late assignments or incorrect (non-java) files will be accepted. This assignment is designed to give you practice with Javadoc, creating unit

CSE360 Assignment 1 No late assignments or incorrect (non-java) files will be accepted.

This assignment is designed to give you practice with Javadoc, creating unit tests and using Junit.Be sure to follow all style and documentation requirements for THIS class.See the style and documentation requirements posted on Canvas.

You are to name your package assign1 and your file Palindrome.java.

Palindrome Class

The method isPalindrome is to determine if a string is a palindrome.A palindrome, for this assignment, is defined as a word or phrase consisting of 0 or more alphanumeric characters that reads the same frontwards and backwards while ignoring cases, punctuation and white space.If there are no alphanumeric characters, it is considered a palindrome.The method should return true if it is a palindrome and false otherwise.

For this assignment, you are limited to the following Java library classes. - Scanner - String - Character Here are the restrictions on the isPalindrome() method.Up to 20% penalty if not followed. 1. You may NOT return from the inside of a loop. 2. You may NOT break from the inside of a loop. 3. You may use ONLY ONE loop (either while or do-while).4. You may NOT copy the String to another String. 5. You may NOT process the String more than one time (only make one pass through it). 6. You must STOP processing as early as possible (when you find that it is or is not a palindrome). In other words, using a for loop is not a good solution.

Palindrome

- testString : String

+ Palindrome (String)

+ isPalindrome (): boolean

Testing 1. Generate the initial set of junit test cases.All should have the initial result of "fail".This will create the file "PalindromeTest.java". There is an example of creating junit tests in the PowerPoint slides with this assignment.This process may vary with your version of Java.

2. Feel free to work with your teaching assistant to help with this process.

3. In addition, there are a lot of tutorials online to help you.Here are a couple of sources I found. https://www.vogella.com/tutorials/JUnit/article.html https://www.youtube.com/watch?v=bdc5WbKKbK4

4. Complete the code for your test cases.Create new methods as needed for different tests.Your tests should not have any if statements, loops or output.Use the asserts to check the results.Test your code and then test it again.

Submitting

Make sure that all the code meets all coding and documentation standards. The junit test cases should include internal documentation while the Palindrome.java file should contain external documentation.

Using the link on Canvas, submit your Palindrome.java file and your PalindromeTest.java file for grading.These will be downloaded, compiled and graded as well as checked for plagiarism and similarity to other students' work.

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

Students also viewed these Programming questions