Posted: October 9th, 2022

Java stack assignment | Computer Science homework help

Create an array of Strings, and using a stack, reverse the order of the Strings in the array.

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

For example, the strings in the array might be “Joe”, Fred, “Mary”.  The reversed array would be “Mary”, Fred, “Joe”.

You should create a Stack class and a StackElement class for this assignment, then use these classes in your software.  Your stack should be a linked data structure, similar to a linked list.

The main method should initialize an array of Strings – either with an explicit array declaration or by reading the data from a file.  You should have at least five Strings in your array, but the software should work no matter how many Strings are in the array.

Your stack class should maintain a stack pointer and the size of the stack, and should have methods to:

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
  • Push a new element onto a stack (This method should put data onto the stack, which means it must first put the data in a stack element.)
  • Pop an element off the stack and return the data in the element.
  • Print a list of the data in the stack.
  • Return the current stack size.

Please use netbeans on this assingmnet

Expert paper writers are just a few clicks away

Place an order in 3 easy steps. Takes less than 5 mins.

Calculate the price of your order

You will get a personal manager and a discount.
We'll send you the first draft for approval by at
Total price:
$0.00
error: Content is protected !!
Open chat
1
Order through WhatsApp!
affordablepaperwritings.com
Hello!
You Can Now Place your Order through WhatsApp
 

 

Order your essay today and save 30% with the discount code DISCOUNTS2022