for my project I have problem in report
- by pink rose
public stack(int size)
{
this.size=size;
Array = new int[size];
}
public void push(int j)
{
if (top < size)
{
Array[++top] = j;
}
}
public int pop()
{
return Array[top--];
}
public int top()
{
return Array[top];
}
public boolean isEmpty()
{
return (top == -1);
}
}
import javax.swing.JOptionPane; public class menu { private static stack s; private static int numbers[];
public static void main(String args[])
{
start();
}
public static void start()
{
int i = Integer.parseInt(JOptionPane.showInputDialog("1. size of array\n2. data entry\n3. display content\n4. exit"));
switch (i)
{
case 1:
setSize();
break;
case 2:
addElement();
break;
case 3:
showElements();
break;
case 4:
exit();
}
}
public static void setSize()
{
int size = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The Size"));
s = new stack(size);
numbers = new int[10];
start();
}
public static void addElement()
{
for(int x=0;x<s.size;x++)
{
int e = Integer.parseInt(JOptionPane.showInputDialog("Please Enter The Element"));
numbers[e]++;
s.push(e);
}
start();
}
public static void showElements()
{
String result = "";
int temp;
while (!s.isEmpty())
{
temp = s.pop();
if (numbers[temp] == 1)
{
result = temp+result;
}
}
JOptionPane.showMessageDialog(null, result);
start();
}
public static void exit()
{
System.exit(0);
}
}
This my project I was finished but I have problem in question in my report
Conclusion. It should summarize the state of your project and indicate which part of your project is working and which part is not working or with limitations. You may also provide your suggestions and comments to this project
what I can answer I didn't have any idea