Maurice Tutor

(5)

$15/per page/Negotiable

About Maurice Tutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Algebra,Applied Sciences See all
Algebra,Applied Sciences,Biology,Calculus,Chemistry,Economics,English,Essay writing,Geography,Geology,Health & Medical,Physics,Science Hide all
Teaching Since: May 2017
Last Sign in: 405 Weeks Ago, 6 Days Ago
Questions Answered: 66690
Tutorials Posted: 66688

Education

  • MCS,PHD
    Argosy University/ Phoniex University/
    Nov-2005 - Oct-2011

Experience

  • Professor
    Phoniex University
    Oct-2001 - Nov-2016

Category > Computer Science Posted 14 Sep 2017 My Price 10.00

implementation of the ArrayStack

//Complete the implementation of the ArrayStack class presented in this chapter.
// Specifically, complete the implementations of the peak, isEmpty, size, and toString methods.

//Please fix this so it compiles correctly and tell me what is going wrong!!

import java.io.*;
class ArrayStack
{
int top;
int size;
int max;
int array[]=new int array[];//THIS IS MESSED UP
  
ArrayStack(int t,int max)
{
top=t;
size=t;
array = new int[max];
}
  
boolean isEmpty()
{
if(top==-1)
return true;
else
return false;
}
  
int size()
{
return size;
}
  
int peak()
{
return max;
}
  
public String toString() //NEED HELP WITH i
{
String a="";
for(i=top;i<=size;i++)
{
int val=this.arr[i];
a=a+val;
}
return a;   
}
  
public static void main(String args[])throws IOException
{
ArrayStack b=new ArrayStack(1,10);
boolean empty = b.isEmpty();
if(empty==true)
System.out.println("THIS IS STACK IS EMPTY");
else
System.out.println("THIS STACK IS NOT EMPTY");
  
int current=b.size();
System.out.println("CURRENT SIZE: " + current);
  
int max=b.peak();
System.out.println("PEAK SIZE: " + max);
  
String s=ob.toString();
System.out.println("FINAL STRING: " + a);
  
}
}

Answers

(5)
Status NEW Posted 14 Sep 2017 07:09 PM My Price 10.00

Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll

Not Rated(0)