Monday, January 18, 2010

[Java] Re: can someone help me on a school assignment

 

I could write this program in less than a half hour.
However, that's not what this group is about.
Rather, show us what you have thought / designed / coded / tested or whatever.
Then we can discuss particular stumbling blocks.

Here is part of what I mean:
What objects do you see?
What characteristics(properties) does each object have?
What behaviors(methods) does each object have?

Hint
I see two objects:
1 FlipStack
properties
the stack (some kind of array)
the next position (for the next char)
methods
initialize
push
pop
is it empty
2 FlipStackTestDriver
properties
a FlipStack
methods
main
instantiates the FlipStack,
some kind of loop
push one byte
another loop
pop one byte
display results

Try coding that. If you get stuck, come on back, but be specific.

Note this can all be done in one class by moving the main method into the FlipStack class. Also, if you do it with two classes, you might want to ask your instructor which class he'd like to have do the popping and display.

--- In Java_Official@yahoogroups.com, "h.graham13" <h.graham13@...> wrote:
>
> I need someone to show me how to implement the standard stack procedures (push, pop, and isempty) using an array. They will be called by a driver which accepts up to 80 characters at a time, places each character on the stack, and, once finished receiving characters, then displays them in reversed order. I am not allowed to use any built-in functions. Any help would be greatly appreciated.
>

__._,_.___
Visit http://aiaiai.com or http://jgame.org for more groups to join.
Java Official Group is created for the following topics: Java 2 Enterprise Edition - J2EE, Java 2 Standard Edition - J2SE, Java 2 Micro Edition - J2ME, XML, XSL, XSD, XPATH, Web Services, Jini, JXTA for all type of Java Geeks.
Whoever posts spam / ads / job related message will be BANNED IMMEDIATELY
.

__,_._,___

No comments:

Post a Comment