Answer:
See explaination
Explanation:
StackExample.java
public class StackExample<T> {
private final static int DEFAULT_CAPACITY = 100;
private int top;
private T[] stack = (T[])(new Object[DEFAULT_CAPACITY]);
/**
* Returns a reference to the element at the top of this stack.
* The element is not removed from the stack.
* atreturn element on top of stack
* atthrows EmptyCollectionException if stack is empty
*/
public T peek() throws EmptyCollectionException
{
if (isEmpty())
throw new EmptyCollectionException("stack");
return stack[top-1];
}
/**
* Returns true if this stack is empty and false otherwise.
* atreturn true if this stack is empty
*/
public boolean isEmpty()
{
return top < 0;
}
}
//please replace "at" with the at symbol
Note:
peek() method will always pick the first element from stack. While calling peek() method when stack is empty then it will throw stack underflow error. Since peek() method will always look for first element ffrom stack there is no chance for overflow of stack. So overflow error checking is not required. In above program we handled underflow error in peek() method by checking whether stack is an empty or not.
Answer:
C: Security
Explanation:
Communications and information systems principles need to be, among other things, secure. They need to be able to protect sensitive information from those who intentionally not need to know. Some incident information like voice, networks, and data, are very sensitive and thus, should be secure to the right levels and should comply with privacy laws and data protection.
Microsoft Online is free to use. It includes Microsoft Excel, Word, One - Note and PowerPoint. Microsoft Outlook (email app) is free as well, although it is a seperate download.
Another way to go is via Google docs, The Google drive is rather large and safe to store reports, docs, images, etc.
Both Microsoft online and Google Docs are accessible to use on virtually any device as in: PCs, Laptops, Tablets, Androids and Iphones.
Answer:
Following are the program in the Python Programming Language.
#set list type variable and initialize the elements
myPizza = ['Margarita', 'Capsicum and onion', 'Chicken']
#set variable and initialize the elements
frndPizzas = myPizza[:]
#append value in list variable
myPizza.append('Corn')
#append value in list variable
frndPizzas.append('paperica')
#print message
print("My pizzas are:")
#set the for loop and print elements of 1st list
for pizza in myPizza:
print(pizza)
#print message
print("\nFriend's pizzas are:")
#set the for loop and print elements of 2st list
for frndsPizza in frndPizzas:
print(frndsPizza)
<u>Output</u>:
My pizzas are:
Margarita
Capsicum and onion
Chicken Corn
Friend's pizzas are:
Margarita Capsicum and onion Chicken paperica
Explanation:
<u>Following are the description of the program</u>:
- Set a list data type variable that is 'myPizza' and initializes elements in it.
- Set another list data type variable that is 'frndPizzas' and initializes elements in it.
- Append one-one element in both of the list data type variables.
- Set the for loops to print the elements of both list data type variables.
Investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.It is advisable to invest more portion in bonds is safe and will give higher return for investment than stocks
Explanation:
1. According to the graph investing in 90% bonds and 10% stocks will provide an average return of 6% on investment.
2.Investing in bonds is safe than stocks ., because bonds bear fixed rate of interest ., and investing in the bonds having very less risk than the stocks. By comparing stocks and bonds with the help of graph ., it's very clear bonds has a positive growth starting minimum at 32.6% to maximum at 64.2% as returns .But stocks has a negative growth (value) from -8.2% to maximum -43.1% .,It is advisable to invest more portions in bonds is safe and better than invest in stocks.