public class Book{
public String title;
public String author;
public int year;
public String publisher;
public double cost;
public Book(String title,String author,int
year,String publisher,double cost){
this.title=title;
this.author=author;
this.year=year;
this.publisher=publisher;
this.cost=cost;
}
public String getTitle(){
return title;
}
public String getAuthor(){
return author;
}
public int getYear(){
return year;
}
public String getPublisher(){
return publisher;
}
public double getCost(){
return cost;
}
public String toString(){
return "Book Details: "
+ title + ", " + author + ", " + year + ", " + publisher + ", " +
cost;
}
}
public interface MyQueue {
public abstract boolean enQueue(int v);
public abstract int deQueue();
public abstract boolean isFull();
public abstract boolean isEmpty();
public abstract int size();
public abstract int peek();
}
public interface MyStack {
public abstract boolean isEmpty();
public abstract boolean isFull();
public abstract boolean push(T v);
public abstract T pop();
public abstract T peek();
}
public class MyQueueImpl implements MyQueue {
private int capacity;
private int front;
private int rear;
private int[] arr;
public MyQueueImpl(int capacity){
this.capacity = capacity;
this.front = 0;
this.rear = -1;
this.arr = new
int[this.capacity];
}
@Override
public boolean enQueue(int v) {
if(this.rear ==
this.capacity - 1) {
//Perform shift
int tempSize = this.size();
for(int i=0; i < tempSize; i++) {
arr[i] = arr[front];
front++;
}
front = 0;
rear = tempSize - 1;
}
this.rear
++;
arr[rear] =
v;
return
true;
}
@Override
public int deQueue() {
return arr[front++];
}
public String toString() {
String content = "Queue :: ";
for(int i=front; i<= rear; i++)
{
content += "\n"
+ arr[i];
}
return content;
}
@Override
public boolean isFull() {
return (this.size() ==
this.capacity);
}
@Override
public int size() {
return rear - front + 1;
}
@Override
public boolean isEmpty() {
// TODO Auto-generated method
stub
return (this.size() == 0);
}
@Override
public int peek() {
// TODO Auto-generated method
stub
return this.arr[this.front];
}
}
import java.lang.reflect.Array;
public class MyStackImpl implements MyStack {
// TODO write your code here
@Override
public boolean isEmpty() {
// TODO Auto-generated method
stub
return false;
}
@Override
public boolean isFull() {
// TODO Auto-generated method
stub
return false;
}
@Override
public boolean push(T v) {
// TODO write your code here
return true;
}
@Override
public T pop() {
// TODO write your code here
return null;
}
public String toString() {
// TODO write your code here
return "";
}
@Override
public T peek() {
// TODO Auto-generated method
stub
return null;
}
}
make test classs
write your code here
Create a queue object.
insert 5 Books in the
Queue
Create a stack object.
Use the stack to reverse
order of the elements in the queue.
In: Computer Science
List 5 types of non-metallic lustre, with common mineral examples for each. Also list a mineral example with each of a metallic and sub-metallic lustre.
Type of Non-metallic Lustre Mineral Example
______________________ _________________________
______________________ _________________________
______________________ _________________________
______________________ _________________________
______________________ _________________________
Mineral Example of Metallic Lustre
_____________________________
Mineral Example of Sub-Metallic Lustre
_____________________________
In: Other
What’s the difference between a commercial bank and an investment bank? List one example of each and briefly describe its primary function.
What are some important differences between mutual funds, Exchange Traded Funds, and hedge funds? How are they similar? List one example for each.
In: Finance
Using RAPTOR create a program that allows the user to input a list of first names in on array and last names into a parallel array. Input should be terminated when the user enters a sentinel character. the output should be a list of email address where the address is of the following form: [email protected]
In: Computer Science
1. List a bacterial pathogen which causes disease by the production of toxins and provide a therapeutic strategy to treat the disease.
2. List a bacterial pathogen which can be directly acquired from an animal (alive or dead), describe the disease and explain why it would be difficult to eradicate the disease.
In: Biology
Create a list of organisms the represent the evolution of major groups of plants starting from the earliest protist relative: The list should include i. the type of plants (group name), ii. the key adaptation that makes that group unique iii. the advantage that the specific adaptation conveyed to that group of plants
In: Biology
A) List two reasons (other than the expected errors in the dimension meaurements) why your measured value for the density of steel may differ from the accepted value
B) List two reasons that might explain any percent difference between the two values for the density of copper.
In: Physics
4. Explain why the aggregate supply curve is positively sloped during the short run and vertical in the long run.
5. List some examples of factors that will shift the aggregate demand curve.
6. List some examples of factors that will shift the long-run aggregate supply curve.
In: Economics
Write a recursive method using Java that takes a string s as input and returns a list that contains all the anagrams of the string s. An anagram is a word formed by rearranging the letters of a different word. For instance, the word ‘cat’ is an anagram of ‘act’. Notice that the output list cannot contain duplicates.
In: Computer Science
#1: List 3 hormones that are involved in the digestive system and give their site of origin, what they do and what are their targets.
#2: The kidney regulates blood pressure. List 3 hormones that are involved in regulating one’s blood pressure. Give their site of origin, what they do and what are their targets
In: Anatomy and Physiology