Python
1. Change the order of an input string based on Unicode equivalent.
Write a function Reorder that will take an input string of a maximum length of 20 characters and create a new string that reorders the string based on it’s binary Unicode character equivalent, e.g. ‘a’ = 0x61, ‘A’ = 0x41, from smallest value to largest value. In this example, ‘A’ would come before ‘a’, as 0x41 is a smaller number than ox61. Note, use python logical operators to do the comparison. Do not try to create a Unicode lookup table. For your code, use the string “sum=(x*259)/average” as your input string to your function.
In: Computer Science
Show the values contained in the instance variables elements and numElements of the sample collection after the following sequence of operations:
ArrayCollection<String> sample = new ArrayCollection<String>; sample.add("A"); sample.add("B"); sample.add("C"); sample.add("D"); sample.remove("B");
//---------------------------------------------------------------------------
// ArrayCollection.java by Dale/Joyce/Weems Chapter 5
//
// Implements the CollectionInterface using an array.
//
// Null elements are not allowed. Duplicate elements are
allowed.
//
// Two constructors are provided: one that creates a collection of
a default
// capacity, and one that allows the calling program to specify the
capacity.
//---------------------------------------------------------------------------
package ch05.collections;
public class ArrayCollection<T> implements
CollectionInterface<T>
{
protected final int DEFCAP = 100; // default capacity
protected T[] elements; // array to hold collection’s
elements
protected int numElements = 0; // number of elements in this
collection
// set by find method
protected boolean found; // true if target found, otherwise
false
protected int location; // indicates location of target if
found
public ArrayCollection()
{
elements = (T[]) new Object[DEFCAP];
}
public ArrayCollection(int capacity)
{
elements = (T[]) new Object[capacity];
}
protected void find(T target)
// Searches elements for an occurrence of an element e such
that
// e.equals(target). If successful, sets instance variables
// found to true and location to the array index of e. If
// not successful, sets found to false.
{
location = 0;
found = false;
while (location < numElements)
{
if (elements[location].equals(target))
{
found = true;
return;
}
else
location++;
}
}
public boolean add(T element)
// Attempts to add element to this collection.
// Returns true if successful, false otherwise.
{
if (isFull())
return false;
else
{
elements[numElements] = element;
numElements++;
return true;
}
}
public boolean remove (T target)
// Removes an element e from this collection such that
e.equals(target)
// and returns true; if no such element exists, returns
false.
{
find(target);
if (found)
{
elements[location] = elements[numElements - 1];
elements[numElements - 1] = null;
numElements--;
}
return found;
}
public boolean contains (T target)
// Returns true if this collection contains an element e such
that
// e.equals(target); otherwise, returns false.
{
find(target);
return found;
}
public T get(T target)
// Returns an element e from this collection such that
e.equals(target);
// if no such element exists, returns null.
{
find(target);
if (found)
return elements[location];
else
return null;
}
public boolean isFull()
// Returns true if this collection is full; otherwise, returns
false.
{
return (numElements == elements.length);
}
public boolean isEmpty()
// Returns true if this collection is empty; otherwise, returns
false.
{
return (numElements == 0);
}
public int size()
// Returns the number of elements in this collection.
{
return numElements;
}
}
In: Computer Science
Regional trading blocs, such as the European Union (EU) and NAFTA, are growing in importance. Why do you think this is so - what do countries gain from joining a regional trading bloc? What the implications of these trading blocs for international business? Are they helpful or harmful? How might they affect a firm's investment decision?
In: Economics
Bilboa Freightlines, S.A., of Panama, has a small truck that it uses for intracity deliveries. The truck is worn out and must be either overhauled or replaced with a new truck. The company has assembled the following information:
|
Present Truck |
New Truck |
|||||
| Purchase cost new | $ | 35,000 | $ | 50,000 | ||
| Remaining book value | $ | 25,000 | - | |||
| Overhaul needed now | $ | 24,000 | - | |||
| Annual cash operating costs | $ | 18,500 | $ | 18,000 | ||
| Salvage value-now | $ | 15,000 | - | |||
| Salvage value-five years from now | $ | 11,000 | $ | 9,000 | ||
If the company keeps and overhauls its present delivery truck, then the truck will be usable for five more years. If a new truck is purchased, it will be used for five years, after which it will be traded in on another truck. The new truck would be diesel-operated, resulting in a substantial reduction in annual operating costs, as shown above.
The company computes depreciation on a straight-line basis. All investment projects are evaluated using a 13% discount rate.
Click here to view Exhibit 13B-1 and Exhibit 13B-2, to determine the appropriate discount factor(s) using tables.
Required:
1. What is the net present value of the “keep the old truck” alternative?
2. What is the net present value of the “purchase the new truck” alternative?
3. Should Bilboa Freightlines keep the old truck or purchase the new one?
In: Accounting
In: Physics
What would be the effect of each of the following sources of error in the reaction between Mg and HCl? Would they result in a high, low, or unaffected value for the heat of reaction? Why?
A. The calorimeter absorbs heat.
B. The thermometer reads 2 °C low at all temperatures.
C. The actual molarity of the HCl is slightly higher than reported
on the bottle.
D. The mass of the filter paper was not subtracted in the determination of ∆H1.
In: Chemistry
The following data were taken from the financial statements of Hunter Inc. for December 31 of two recent years:
| Current Year | Previous Year | |||
| Accounts payable | $95,000 | $144,000 | ||
| Current maturities of serial bonds payable | 200,000 | 200,000 | ||
| Serial bonds payable, 10% | 1,010,000 | 1,210,000 | ||
| Common stock, $1 par value | 60,000 | 60,000 | ||
| Paid-in capital in excess of par | 570,000 | 580,000 | ||
| Retained earnings | 1,980,000 | 1,580,000 | ||
The income before income tax was $447,700 and $391,700 for the current and previous years, respectively.
a. Determine the ratio of liabilities to stockholders' equity at the end of each year. Round to one decimal place.
| Current year | |
| Previous year |
b. Determine the times interest earned ratio for both years. Round to one decimal place.
| Current year | |
| Previous year |
In: Accounting
Explain what evolutionary adaptations, in general, exist in hyperthermophilic bacteria in terms of their cell membranes and cellular proteins. Your answer should explain how such adaptations provide advantages in terms of protein and membrane function at extremely high temperatures.
In: Biology
Draw a landscape image using python coding.
In: Computer Science
USE JAVA
Write a static generic method PairUtil.minmax that computes the minimum and maximum elements of an array of type T and returns a pair containing the minimum and maximum value. Require that the array elements implement the Measurable interface of Chapter 10.
In: Computer Science
What is the osmotic pressure, in torr, of a 3.00% solution of
NaCl in water when the temperature of the solution is 45 ºC? Enter
your answer scientific notation.
In: Chemistry
reate a class Song with the data members listed below:
Include the following member functions:
You only need to write the class definition and any code that is
required for that class (i.e., header and implementation).
NOTE: you must not use the implicit "private" for class data types
and methods. Include public or private explicitly.
In: Computer Science
The American Society of PeriAnesthesia Nurses (ASPAN; www.aspan.org) is a national organization serving nurses practicing in ambulatory surgery, preanesthesia, and postanesthesia care. The organization's membership is listed below.
| State/Region | Membership | ||
| Alabama | 102 | ||
| Arizona | 420 | ||
| Maryland, Delaware, DC | 471 | ||
| Connecticut | 177 | ||
| Florida | 432 | ||
| Georgia | 330 | ||
| Hawaii | 84 | ||
| Maine | 51 | ||
| Minnesota, Dakotas | 360 | ||
| Missouri, Kansas | 325 | ||
| Mississippi | 128 | ||
| Nebraska | 77 | ||
| North Carolina | 368 | ||
| Nevada | 121 | ||
| New Jersey, Bermuda | 508 | ||
| Alaska, Idaho, Montana,Oregon, Washington | 716 | ||
| New York | 1,016 | ||
| Ohio | 833 | ||
| Oklahoma | 209 | ||
| Arkansas | 89 | ||
| Illinois | 492 | ||
| Indiana | 332 | ||
| Iowa | 83 | ||
| Kentucky | 236 | ||
| Louisiana | 290 | ||
| Michigan | 413 | ||
| Massachusetts | 540 | ||
| California | 1,173 | ||
| New Mexico | 62 | ||
| Pennsylvania | 443 | ||
| Rhode Island | 43 | ||
| Colorado | 443 | ||
| South Carolina | 281 | ||
| Texas | 1,168 | ||
| Tennessee | 169 | ||
| Utah | 88 | ||
| Virginia | 412 | ||
| Vermont, New Hampshire | 109 | ||
| Wisconsin | 471 | ||
| West Virginia | 77 | ||
|
Mean: Median: Standard Deviation: b-1. Find the coefficient of skewness, using the software method. (Round your answer to 2 decimal places.) Coefficient of skewness: b-2. What do you conclude about the shape of the distribution of component size? a. Mild positive skewness b. Mild negative skewness c. Determine the first and third quartiles. Do not use the method described by Excel. (Round your answers to 2 decimal places.) First Quartile: Third Quartile: d-1. Are there any outliers? a. Three b. One c. Two d. Four e. Zero d-2. What are the limits for outliers? (Round your answers to the nearest whole number. Negative amounts should be indicated by a minus sign.) Limits _____ to _____ |
|||
In: Math
What is profit? There is accounting profit discussed in the textbook: profit = total revenues – explicit costs Let me relate profit to the factors of production. The three factors of production according to the textbook are land, labor, and capital. Let me add a fourth factor found in many economics textbooks: a return to the entrepreneur! (Entrepreneurs provide two services to society: organize resources and assume risk.) So how does a firm or entrepreneur maximize its profits? The answer is simple: provide society what it wants. (Note: this may be different from what society needs.) Note: Given this perspective, profit is something inherently good, something to be maximized, not feared. Let’s refine our understanding of this concept. Normal profit is that return necessary to attract and maintain entrepreneurial participation in some economic activity. Economic rent is return greater than normal profit.
Response:
In: Economics
Explain what types of financial and management goals Medi-Supply might have as the company moves forward to look for investors. (75–150 words, or 1–2 paragraphs)
In: Finance