Consider an electrochemical cell involving the overall
reaction
2 AgBr(s) + Pb(s) → Pb2+(aq) + 2 Ag(s) + 2 Br–(aq)
Each half-reaction is carried out in a separate compartment. The
anion included in the lead half-cell is NO3–. The cation in the
silver half-cell is K+. The two half-cells are connected by a KNO3
salt bridge. If [Pb2+] = 1.0 M and [Br-] = 0.14 M, what is the emf
of the cell at 298 K?
Given:
AgBr(s) + e– → Ag(s) + Br–(aq) E° = +0.07 V.
Pb+2 + 2e– → Pb(s) E° = - 0.13 V.
In: Chemistry
Which of the following statements about information technology is NOT true? a. It has resulted in leaner organizations. b. It has increased collaboration among employees. c. It has improved management processes. d. It provides more flexible operations. e. It has provided more down time for employees.
In: Operations Management
What_advantages _do_ finance_ companies_ have over commercial banks in offering services to small business customers? What are the major subcategories of business loans? Which category is largest?
In: Finance
A mountain climber jumps a 3.2m -wide crevasse by leaping horizontally with a speed of 7.1m/s . If the climber's direction of motion on landing is -45?, what is the height difference between the two sides of the crevasse?
In: Physics
Suppose you own an outdoor recreation company and you want to purchase all-terrain vehicles (ATVs) for your summer business and snowmobiles for your winter business. Your budget for new vehicles this year is $240,000. ATVs cost $8000 each and snowmobiles cost $12,000 each.
a.Draw a budget line for your purchase of new vehicles.
b. What is the opportunity cost of one ATV?
c. What is the opportunity cost of one snowmobile?
In: Economics
Beck Inc. and Bryant Inc. have the following operating data:
| Beck Inc. | Bryant Inc. | |||
| Sales | $290,900 | $895,000 | ||
| Variable costs | 116,700 | 537,000 | ||
| Contribution margin | $174,200 | $358,000 | ||
| Fixed costs | 107,200 | 179,000 | ||
| Income from operations | $67,000 | $179,000 | ||
a. Compute the operating leverage for Beck Inc. and Bryant Inc. If required, round to one decimal place.
| Beck Inc. | |
| Bryant Inc. |
b. How much would income from operations increase for each company if the sales of each increased by 15%? If required, round answers to nearest whole number.
| Dollars | Percentage | ||
| Beck Inc. | $ | % | |
| Bryant Inc. | $ | % | |
c. The difference in the of income from operations is due to the difference in the operating leverages. Beck Inc.'s operating leverage means that its fixed costs are a percentage of contribution margin than are Bryant Inc.'s.
In: Accounting
2. What is the consequence of using unconditional logistic regression to analyze the data collected from a 1:M matched case-control study?
In: Math
Python program problem:
A group of statisticians at a local college has asked you to create a set of functions that compute the median and mode of a set of numbers. Define these functions, median and mode, in a module named stats.py. Also include a function named mean, which computes the average of a set of numbers. Each function should expect a list of numbers as an argument and return a single number. Each function should return 0 if the list is empty. Include a main function that tests the three statistical functions using the following list defined in main: userList = [3, 1, 7, 1, 4, 10] An example of the program output is shown below: List: [3, 1, 7, 1, 4, 10] Mode: 1 Median: 3.5 Mean: 4.33
In: Computer Science
Problem 13-3A Transactions, working capital, and liquidity ratios LO P3 Plum Corporation began the month of May with $1,100,000 of current assets, a current ratio of 2.60:1, and an acid-test ratio of 1.30:1. During the month, it completed the following transactions (the company uses a perpetual inventory system). May 2 Purchased $55,000 of merchandise inventory on credit. 8 Sold merchandise inventory that cost $55,000 for $150,000 cash. 10 Collected $31,000 cash on an account receivable. 15 Paid $29,000 cash to settle an account payable. 17 Wrote off a $5,000 bad debt against the Allowance for Doubtful Accounts account. 22 Declared a $1 per share cash dividend on its 65,000 shares of outstanding common stock. 26 Paid the dividend declared on May 22. 27 Borrowed $90,000 cash by giving the bank a 30-day, 10% note. 28 Borrowed $105,000 cash by signing a long-term secured note. 29 Used the $195,000 cash proceeds from the notes to buy new machinery. Required: Complete the table below showing Plum's (1) current ratio, (2) acid-test ratio, and (3) working capital after each transaction. (Do not round intermediate calculations. Round your ratios to 2 decimal places and the working capitals to nearest dollar amount. Subtracted amount should be indicated with a minus sign.)
In: Accounting
What is the internal rate of return (to the nearest one-half percent) on an investment costing $500,000 and having expected future after-tax net cash flows of:
|
Year |
Net Cash Flow ($) |
|
|
1 |
100,000 |
|
|
2 |
150,000 |
|
|
3 |
150,000 |
|
|
4 |
300,000 |
(includes salvage) |
Use the trial-and-error method and write out all your work. Hint: Start at 11%.
In: Finance
package imageblocks;
import java.awt.Color;
import utils.Picture;
public class ImageBlocks {
static Color BLACK = new Color(0,0,0);
static Color WHITE = new Color(255,255,255);
private int height;
private int width;
boolean [][] visited;
Picture pic;
public ImageBlocks(Picture pic) {
this.pic = pic;
height = pic.height();
width = pic.width();
}
private boolean isBlack(int x,int y){
return pic.get(x,y).equals(BLACK);
}
private boolean isWhite(int x,int y){
return pic.get(x,y).equals(WHITE);
}
/**
* METHOD TO BE COMPLETED
* count the number of image blocks in the given image
* Counts the number of connected blocks in the binary digital
image
* @return number of black blocks
*/
public int countConnectedBlocks(){
//TODO
}
}
== Picture Class for Help ==
public final class Picture implements ActionListener {
private BufferedImage image; // the rasterized image
private JFrame frame; // on-screen view
private String filename; // name of file
private boolean isOriginUpperLeft = true; // location of origin
private final int width, height; // width and height
/**
* Initializes a blank <tt>w</tt>-by-<tt>h</tt> picture, where each pixel is black.
*/
public Picture(int w, int h) {
if (w < 0) throw new IllegalArgumentException("width must be nonnegative");
if (h < 0) throw new IllegalArgumentException("height must be nonnegative");
width = w;
height = h;
image = new BufferedImage(w, h, BufferedImage.TYPE_INT_RGB);
// set to TYPE_INT_ARGB to support transparency
filename = w + "-by-" + h;
}
/**
* Initializes a new picture that is a deep copy of <tt>pic</tt>.
*/
public Picture(Picture pic) {
width = pic.width();
height = pic.height();
image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
filename = pic.filename;
for (int x = 0; x < width(); x++)
for (int y = 0; y < height(); y++)
image.setRGB(x, y, pic.get(x, y).getRGB());
}
/**
* Initializes a picture by reading in a .png, .gif, or .jpg from
* the given filename or URL name.
*/
public Picture(String filename) {
this.filename = filename;
try {
// try to read from file in working directory
File file = new File(filename);
if (file.isFile()) {
image = ImageIO.read(file);
}
// now try to read from file in same directory as this .class file
else {
URL url = getClass().getResource(filename);
if (url == null) { url = new URL(filename); }
image = ImageIO.read(url);
}
width = image.getWidth(null);
height = image.getHeight(null);
}
catch (IOException e) {
// e.printStackTrace();
throw new RuntimeException("Could not open file: " + filename);
}
}
/**
* Initializes a picture by reading in a .png, .gif, or .jpg from a File.
*/
public Picture(File file) {
try { image = ImageIO.read(file); }
catch (IOException e) {
e.printStackTrace();
throw new RuntimeException("Could not open file: " + file);
}
if (image == null) {
throw new RuntimeException("Invalid image file: " + file);
}
width = image.getWidth(null);
height = image.getHeight(null);
filename = file.getName();
}
/**
* Returns a JLabel containing this picture, for embedding in a JPanel,
* JFrame or other GUI widget.
*/
public JLabel getJLabel() {
if (image == null) { return null; } // no image available
ImageIcon icon = new ImageIcon(image);
return new JLabel(icon);
}
/**
* Sets the origin to be the upper left pixel.
*/
public void setOriginUpperLeft() {
isOriginUpperLeft = true;
}
/**
* Sets the origin to be the lower left pixel.
*/
public void setOriginLowerLeft() {
isOriginUpperLeft = false;
}
/**
* Displays the picture in a window on the screen.
*/
public void show() {
// create the GUI for viewing the image if needed
if (frame == null) {
frame = new JFrame();
JMenuBar menuBar = new JMenuBar();
JMenu menu = new JMenu("File");
menuBar.add(menu);
JMenuItem menuItem1 = new JMenuItem(" Save... ");
menuItem1.addActionListener(this);
menuItem1.setAccelerator(KeyStroke.getKeyStroke(KeyEvent.VK_S,
Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()));
menu.add(menuItem1);
frame.setJMenuBar(menuBar);
frame.setContentPane(getJLabel());
// f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
frame.setTitle(filename);
frame.setResizable(false);
frame.pack();
frame.setVisible(true);
}
// draw
frame.repaint();
}
/**
* Returns the height of the picture (in pixels).
*/
public int height() {
return height;
}
/**
* Returns the width of the picture (in pixels).
*/
public int width() {
return width;
}
/**
* Returns the color of pixel (<em>x</em>, <em>y</em>).
*/
public Color get(int x, int y) {
if (x < 0 || x >= width()) throw new IndexOutOfBoundsException("x must be between 0 and " + (width()-1));
if (y < 0 || y >= height()) throw new IndexOutOfBoundsException("y must be between 0 and " + (height()-1));
if (isOriginUpperLeft) return new Color(image.getRGB(x, y));
else return new Color(image.getRGB(x, height - y - 1));
}
/**
* Sets the color of pixel (<em>x</em>, <em>y</em>) to given color.
*/
public void set(int x, int y, Color color) {
if (x < 0 || x >= width()) throw new IndexOutOfBoundsException("x must be between 0 and " + (width()-1));
if (y < 0 || y >= height()) throw new IndexOutOfBoundsException("y must be between 0 and " + (height()-1));
if (color == null) throw new NullPointerException("can't set Color to null");
if (isOriginUpperLeft) image.setRGB(x, y, color.getRGB());
else image.setRGB(x, height - y - 1, color.getRGB());
}
/**
* Is this Picture equal to obj?
*/
public boolean equals(Object obj) {
if (obj == this) return true;
if (obj == null) return false;
if (obj.getClass() != this.getClass()) return false;
Picture that = (Picture) obj;
if (this.width() != that.width()) return false;
if (this.height() != that.height()) return false;
for (int x = 0; x < width(); x++)
for (int y = 0; y < height(); y++)
if (!this.get(x, y).equals(that.get(x, y))) return false;
return true;
}
/**
* Saves the picture to a file in a standard image format.
* The filetype must be .png or .jpg.
*/
public void save(String name) {
save(new File(name));
}
/**
* Saves the picture to a file in a standard image format.
*/
public void save(File file) {
this.filename = file.getName();
if (frame != null) { frame.setTitle(filename); }
String suffix = filename.substring(filename.lastIndexOf('.') + 1);
suffix = suffix.toLowerCase();
if (suffix.equals("jpg") || suffix.equals("png")) {
try { ImageIO.write(image, suffix, file); }
catch (IOException e) { e.printStackTrace(); }
}
else {
System.out.println("Error: filename must end in .jpg or .png");
}
}
/**
* Opens a save dialog box when the user selects "Save As" from the menu.
*/
public void actionPerformed(ActionEvent e) {
FileDialog chooser = new FileDialog(frame,
"Use a .png or .jpg extension", FileDialog.SAVE);
chooser.setVisible(true);
if (chooser.getFile() != null) {
save(chooser.getDirectory() + File.separator + chooser.getFile());
}
}
In: Computer Science
I need step by step solution to the following this question asap .I have limited time so please do it quickly with detailed explanation
thanks in advance/Ha
1. “Once a country has a big enough debt/GDP ratio, it is stuck in a trap, because austerity depresses growth.” Do you agree?
In: Economics
A 16.0 mL sample of a 1.56 M potassium sulfate solution is mixed with 14.3 mL of a 0.890 M barium nitrate solution and this precipitation reaction occurs: K2SO4(aq)+Ba(NO3)2(aq)→BaSO4(s)+2KNO3(aq) The solid BaSO4 is collected, dried, and found to have a mass of 2.51 g . Determine the limiting reactant, the theoretical yield, and the percent yield
In: Chemistry
In: Computer Science
*In Java Please!
Tasks
This assignment has three parts:
Task 1 – LinkedList Class
Create a LinkedList class. It may be singly linked, circularly linked, or doubly linked. A singly linked list may be in either direction, forwards or backwards, while a doubly linked list must be in both directions, forwards and backwards. A circularly linked list will connect the end with the beginning, instead of pointing to null, but otherwise it is a singly linked list. We will need at least one private variable which represents the starting point of our list. The nodes for this list will need the typical private fields of next and data, but also count which will store the number of times a specific species of bird has appeared in a survey.
We must also create a constructor for our LinkedList. Let’s create a default constructor that creates a list of size zero.
Next is to create an Add method. This will add the given BirdSpecies object to the end of the list, if the species is not already in the list. If it is in the list, then the variable count of that species is increased by one (remember that count comes from the node, not the list or BirdSpecies class). Also keep track of the position where a new BirdSpecies was added into the list. This will be returned to the Main method.
Another method called GetCount that returns the count of a given BirdSpecies. If that species is not on the list, return zero.
Finally, a GetReport method that returns the name and count of each BirdSpecies on the list. If the list is empty, return a special message that says the list is empty.
Task 2 – BirdSpecies Class
Create a BirdSpecies class that has private variables for the name of the species. Use an overloaded constructor to create a BridSpecies with a given name. Also use a getter and setter that manipulate the name. Finally, let’s make a ToString method that returns the name of the species.
Task 3 – The Tester Class
Create a Tester Class, with a Main method. In the Main method, create one LinkedList object. The values will be entered into the LinkedList using user input and a loop. The loop will keep accepting user input until they enter “done” when asked if they wish to enter another bird species. If the user enters a new bird species into the list, use the ToString method of the new BirdSpecies object to display its name along with the position that it now has in the list. If another bird of the same species is added to the list, display the ToString method of the original BirdSpecies object and its count (but not its position). Finally, print out the list using the GetReport method of the LinkedList.
∃ Some Sample Output:
Enter a bird species: Black-chinned hummingbird
Entered bird species: Black-chinned hummingbird at position 0.
Are you done entering birds? no
Enter a bird species: West African swallow
Entered bird species: West African swallow at position 1.
Are you done entering birds? no
Enter a bird species: Black-chinned hummingbird
Entered bird species: Black-chinned hummingbird, count increased to 2.
Are you done entering birds? done
Contents of the list:
Black-chinned hummingbird with count 2
West African swallow with count 1
You need to implement your sourcecode into the given template below:
//Template for Class BirdSpecies------------------------------------------------------------------
| package com.company; | |
| public class BirdSpecies | |
| { | |
| private String nameOfSpecies; | |
| public BirdSpecies(String nameOfSpecies) | |
| { | |
| //Initialize the name of the bird. | |
| } | |
| public void SetName(String name) | |
| { | |
| //Change the name of the bird. | |
| } | |
| public String GetName() | |
| { | |
| //Return the name of the bird. | |
| } | |
| @Override | |
| public String toString() | |
| { | |
| //Return the name of the bird. | |
| } | |
| } |
// Template for Class LinkedList-------------------------------------------------------------------------------------
package com.company;
public class LinkedList
{
private Node first;
public LinkedList()
{
this.first = null;
}
public int Add(Type data)
{
//CASE 0: List is empty or first is the same species.
//CASE 1: List is not empty, search for species as we move to the
end of the list,
// otherwise add at end.
}
public int GetCount(Type data)
{
//Search through the list looking for the value given.
//Otherwise return 0 if we reached the end.
}
public String GetReport()
{
//CASE 0: List is empty, return a special message.
//CASE 1: List is not empty, return the species and count of
each bird.
//Hint, use the toString of the bird to do so.
}
//Simple Node Class
class Node
{
E data;
Node next;
int count;
public Node(E data)
{
this.data = data;
this.next = null;
this.count = 1;
}
}
}
//Template for Main Class (No change needed here)-------------------------------------------------------
package com.company;
public class Main
{
public static void main(String[] args)
{
LinkedList list = new LinkedList<>();
System.out.println("Entered the black chin at: " + list.Add(new
BirdSpecies("Black-chinned hummingbird")));
System.out.println("Entered the African swallow at: " +
list.Add(new BirdSpecies("West African Swallow")));
System.out.println("Entered the second black chin at: " +
list.Add(new BirdSpecies("Black-chinned hummingbird")));
System.out.println("Entered the African swallow at: " +
list.Add(new BirdSpecies("West African Swallow")));
System.out.println("Count of black chin is: " + list.GetCount(new BirdSpecies("Black-chinned hummingbird")) );
System.out.println(list.GetReport());
}
}
In: Computer Science