Create an array of strings and using a stack

Assignment Help JAVA Programming
Reference no: EM131700791

Assignment

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

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:

• 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.

Reference no: EM131700791

Questions Cloud

Resource availability occupies the center : Resource Availability occupies the center, and the three sides are Scope, Cost, and schedule. Interpret this triangle as if it were a system in balance.
Discuss the ethical implications of organizations monitoring : Either by yourself or in a group, think about the ethical implications of organizations' monitoring and collecting information about their employees.
Protective against hereditary diseases than the x chromosome : The Y chromosome (for males) is less protective against hereditary diseases than the X chromosome. Why then are women considered the weaker sex
Define the scope for a particular project : Describe the tools and approach that you would use to collect requirements and generate at least 20 requirements to define the scope for a particular project.
Create an array of strings and using a stack : Create an array of Strings, and using a stack, reverse the order of the Strings in the array. You should create a Stack class and a StackElement class.
The radio programs have a significant influence on society : Can films, television programs, or radio programs have a significant influence on society
Project governance and the stages in the project : Describe what is involved in project governance and the stages in the project through which the project planning would move.
How much profit does the company make : ENMA 600: Cost Estimation and Financial Analysis - How much PROFIT does the company make over the 10-year production run
What cycle time must be achieved to meet that demand : Given the following information, what cycle time must be achieved to meet that demand?

Reviews

Write a Review

JAVA Programming Questions & Answers

  Create the physical process model

You were hired as an analyst to develop a new information system to automate the payroll transactions in a mid-size organization. The proposed system will contain employees' data and interface with the organization's General Ledger system (GL).

  Delete a random element from an arraylist

Elements in an ArrayList and picking one at random to remove. Unfortunately, this slow, since deleting a random element from an ArrayList is slow because of all the shifting. For this question, you should modify the poll()method so that it runs in..

  Write program that uses a linkedlist object to store a list

Write a program that uses a LinkedList object to store a list of print jobs in a FIFO queue. We will assume that each job has a unique job number that is assigned sequentially, and that the print time is randomly distributed between 10 seconds and..

  Can we run java byte code on android since android

Can we run java byte code on android since android is also java based

  In java programming objects are stored on stack

In java programming Objects are stored on Stack. True/False

  Code that deals with user inputs via mouse

data.txt is data file with text defining the background picture and the various data items.

  Correct example of inheritance

Which of the following relationships is not a correct example of inheritance?  Parent to Children  Aunt to Uncle  Grandparent to Grandchild

  Create a unique 3d animated scene

In this project you will create a unique 3D animated scene composed of Three.js graphic components. The scene should include animation, lighting

  Write partial code using a loop to produces the given output

CSE 110- Write partial code using a loop to produces given output. Write a Java program called Assignment4.java. There are two tasks in this assignment. Your program will ask for user choice and based on which it will switch between the two tasks.

  Develop a script to generate the necessary training

COSC2110/COSC2111 - Describe the data encoding that is required for this task. How many outputs and how many inputs will there be? What scaling or normalization

  Write the method called print triangle type.

Write the method called printTriangleType. This method accepts three integer arguments representing the lengths of the sides of a triangle and prints the type of triangle that these sides form. Here are some sample calls to printTriangleType

  Create a project in eclipse

Create a new project

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd