In: Computer Science
9. How does the answer to question 8 differ from that of a fetal pig?
"Question 8. Describe briefly how Hydra digests food and removes waste from itself."
In: Biology
Create a ShoppingCart class in java that simulates the operation of a shopping cart. The ShoppingCart instance should contain a BagInterface implementation that will serve to hold the Items that will be added to the cart. Use the implementation of the Item object provided in Item.java. Note that the price is stored as the number of cents so it can be represented as an int (e.g., an Item worth $19.99 would have price = 1999).
Using the CLASSES BELOW Your shopping cart should support the following operations:
Add an item
Add multiple quantities of a given item (e.g., add 3 of Item __)
Remove an unspecified item
Remove a specified item
Checkout – should "scan" each Item in the shopping cart (and display its
information), sum up the total cost and display the total cost
Check budget – Given a budget amount, check to see if the budget is large
enough to pay for everything in the cart. If not, remove an Item from the shopping cart, one at a time, until under budget.
Write a driver program to test out your ShoppingCart implementation.
*Item Class*
/**
* Item.java - implementation of an Item to be placed in ShoppingCart
*/
public class Item
{
private String name;
private int price;
private int id;//in cents
//Constructor
public Item(int i, int p, String n)
{
name = n;
price = p;
id = i;
}
public boolean equals(Item other)
{
return this.name.equals(other.name) && this.price == other.price;
}
//displays name of item and price in properly formatted manner
public String toString()
{
return name + ", price: $" + price/100 + "." + price%100;
}
//Getter methods
public int getPrice()
{
return price;
}
public String getName()
{
return name;
}
}
BAG INTERFACE CLASS
/**
* BagInterface.java - ADT Bag Type
* Describes the operations of a bag of objects
*/
public interface BagInterface<T>
{
//getCurrentSize() - gets the current number of entries in this bag
// @returns the integer number of entries currently in the bag
public int getCurrentSize();
//isEmpty() - sees whether the bag is empty
// @returns TRUE if the bag is empty, FALSE if not
public boolean isEmpty();
//add() - Adds a new entry to this bag
// @param newEntry - the object to be added to the bag
// @returns TRUE if addition was successful, or FALSE if it fails
public boolean add(T newEntry);
//remove() - removes one unspecified entry from the bag, if possible
// @returns either the removed entry (if successful), or NULL if not
public T remove();
//remove(T anEntry) - removes one occurrence of a given entry from this bag, if possible
// @param anEntry - the entry to be removed
// @returns TRUE if removal was successful, FALSE otherwise
public boolean remove(T anEntry);
//clear() - removes all entries from the bag
public void clear();
//contains() - test whether this bag contains a given entry
// @param anEntry - the entry to find
// @returns TRUE if the bag contains anEntry, or FALSE otherwise
public boolean contains(T anEntry);
//getFrequencyOf() - count the number of times a given entry appears in the bag
// @param anEntry - the entry to count
// @returns the number of time anEntry appears in the bag
public int getFrequencyOf(T anEntry);
//toArray() - retrieve all entries that are in the bag
// @returns a newly allocated array of all the entries in the bag
// NOTE: if bag is empty, it will return an empty array
public T[] toArray();
}
In: Computer Science
The mean number of students who went to examinations is 450 students with a standard deviation of 75 students. The distribution of the number of students is normal.
In: Statistics and Probability
Exhibit 5-4
A local bottling company has determined the number of machine breakdowns per month and their respective probabilities as shown below.
|
Number of |
||
|
Breakdowns |
Probability |
|
|
0 |
0.12 |
|
|
1 |
0.38 |
|
|
2 |
0.25 |
|
|
3 |
0.18 |
|
|
4 |
0.07 |
Refer to Exhibit 5-4. The expected number of machine breakdowns per month is?
2. The probability of at least 3 breakdowns in a month is
3. The probability of no breakdowns in a month is
4.The expected number of new clients per month is
5. The variance is
6. The standard deviation is
In: Statistics and Probability
400-500 Words
1. What is the rational explanation of the phenomenon of an investment increasing in value while generating losses? (b) Explain the fine line that financial analysts must walk.
2. a) Why would it seem paranoid for a novice analyst to consider every company’s income statement with suspicion? (b) What are telltale danger signals, and then, explain the analogy that “corporate budget systems are designed to reward lies and punish truth.”
3. a) Explain the essential idea of leveraged buyout? (b) Explain how the riddle of a franchiser’s profits and franchisee’s losses can be resolved?
4. a) As an analyst, explain why a careful reading of the Notes to Financial Statements will disclose if a company is exaggerating revenues. (b) Explain how a low P/E multiple company can accelerate its earnings growth and thus become perceived as a high-growth stock.
5. a) How does the use of common form income statements for a peer group allow the analyst to uncover capitalization abuses? (b) What is “restructuring,” and what is the dangerous trap that users of financial statements must avoid?
In: Accounting
Let X be the random variable representing the number of calls received in an hour by a 911 emergency service. A probability distribution of X is given below. Value of X 0 1 2 3 4 Probability P(x) 0.32 ____ ____ 0.16 0.08 (a) Suppose the probability that X = 1 and the probability that X = 2 are the same. What are these probabilities? Incorrect: Your answer is incorrect. (b) What is the probability that at least one call received in an hour? (c) What is the expected number of 911 calls in an hour?
In: Statistics and Probability
In: Math
A spring loaded piston cylinder device contains 3 kg of carbon dioxide which can be assumed to be an ideal gas. The system is heated from 110 kPa, 23C to 1100kPa, 305C. What is the work done during this process? What is the heat transfer during this process?
In: Mechanical Engineering
Refrigerant 22 undergoes a constant-pressure process within a
piston–cylinder assembly from saturated vapor at 5.0 bar to a final
temperature of 25°C. Kinetic and potential energy effects are
negligible.
Evaluate the work and the heat transfer, each in kJ per kg of
refrigerant.
In: Mechanical Engineering