The first assignment lets you practice basic concepts such as encapsulation and abstraction.
A palindrome is a word, phrase, number, or other sequence of characters which reads the same backward or forward. Stack is a simple data structure/container which acts as LIFO (last element in, would be the first element out.)
In this assignment, first, develop a Stack class. Second, develop a second Java class named Palindrome that in its main method, receives a string as a command-line argument, and then uses a Stack object to check whether the given string is a palindrome or not.
Please note the following regarding doing this workshop:
1 You should implement your version of Stack class (Use this link if you need) first. You should not use Stack class in Java API. Objects based off our Stack class just know how to push and pop characters, one at a time. Your Stack class should be a reusable entity and doesnt need to know any of the logic that you are going to put in the second class.
2- Based on the specs for this workshop, your solution should be dealing with a sequence of characters and thus, backed by a char array (as its storage.) Please note that since we have not yet talked about ArrayLists, you should use an array. In case you like to new/initialize your array based on the size of the command-line arguments size, you could do it so through a constructor in your Stack class.
Marking Criteria and Task:
Please note that you should:
- have appropriate indentation.
- have proper file structures and modularization. c- follow Java naming conventions. d- document all the classes properly. e- not have debug/useless code and/or file(s) left in assignment.
f- have good intra and/or inter class designs.
in your code!
- Task: Developing and running the desired solution: (you should submit your source code just individual .java files and screenshots which demonstrate the way your code runs in different scenarios): 5 marks.
Reviews
There are no reviews yet.