Skip to content

Commit

Permalink
added PA2
Browse files Browse the repository at this point in the history
  • Loading branch information
amostafa147 committed Apr 8, 2024
1 parent 9719ab9 commit 4b5ffbf
Show file tree
Hide file tree
Showing 4 changed files with 197 additions and 0 deletions.
Binary file added .DS_Store
Binary file not shown.
94 changes: 94 additions & 0 deletions PA2/MyStack.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
Name: TODO
PID: TODO
*/

import java.util.EmptyStackException;
import utilities.FullStackException;

/**
* MyStack Implementation
* @author TODO
* @since TODO
*/
public class MyStack {

/*
* TODO
* */
public MyStack(int capacity) {
// TODO: complete implementation
}

/*
* TODO
* */
public MyStack() {
// TODO: complete implementation
}

/*
* TODO
* */
public boolean isEmpty() {
// TODO: complete implementation
}

/*
* TODO
* */
public void clear() {
// TODO: complete implementation
}

/*
* TODO
* */
public int size() {
// TODO: complete implementation
}

/*
* TODO
* */
public int capacity() {
// TODO: complete implementation
}

/*
* TODO
* */
public String peek() {
// TODO: complete implementation
}

/*
* TODO
* */
public void push(String element) {
// TODO: complete implementation
}

/*
* TODO
* */
public String pop() {
// TODO: complete implementation
}

/*
* TODO
* */
public void multiPush(String[] elements) {
// TODO: complete implementation
}

/*
* TODO
* */
public String[] multiPop(int amount) {
// TODO: complete implementation
}


}
90 changes: 90 additions & 0 deletions PA2/WebBrowser.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
import java.util.ArrayList;
import utilities.FullStackException;



/*
* NAME: TODO First Last
* PID: TODO Axxxxxxxx
*/

/**
* TODO
*
* @author TODO
* @since TODO
*/
public class WebBrowser {

private String currentPage;
private ArrayList<String> history;
private MyStack prev;
private MyStack next;

private static final String DEFAULT_PAGE = "google.com";

/**
* TODO
*/

public WebBrowser() {
// TODO: complete implementation
}

/**
* TODO
*/
public String getCurrentPage() {
// TODO: complete implementation
}

/**
* TODO
*/
public void openNewPage(String newLink) {
// TODO: complete implementation
}

/**
* TODO
*/
public void previousPage() {
// TODO: complete implementation
}

/**
* TODO
*/
public void nextPage() {
// TODO: complete implementation
}

/**
* TODO
*/
public void newTab() {
// TODO: complete implementation
}

/**
* TODO
*/
public ArrayList getHistory() {
// TODO: complete implementation
}

/**
* TODO
*/
public void clearHistory() {
// TODO: complete implementation
}

/**
* TODO
*/
public boolean findLink(String link) {
// TODO: complete implementation
}

}
13 changes: 13 additions & 0 deletions PA2/utilities/FullStackException.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package utilities;

public class FullStackException extends RuntimeException {
// no-argument constructor
public FullStackException() {
this( "Stack is full" );
} // end no-argument FullStackException constructor

// one-argument constructor
public FullStackException( String exception ) {
super( exception );
} // end one-argument FullStackException constructor
} // end class FullStackException

0 comments on commit 4b5ffbf

Please sign in to comment.