Questions
JAVA- Modify the LinkedList1 class presented in this chapter by adding sort() and reverse() methods. The...

JAVA-

Modify the LinkedList1 class presented in this chapter by adding sort() and reverse() methods. The reverse method reverses the order of the elements in the list, and the sort method rearranges the elements in the list so they are sorted in alphabetical order. The class should use recursion to implement the sort and reverse operations. Extend the graphical interface in the LinkedList1Demo class to support sort and reverse commands, and use it to test the new methods.

LinkedList1:

class LinkedList1
{
  
private class Node
{
String value;
Node next;
  
  
  
Node(String val, Node n)
{
value = val;
next = n;
}
  
  
  
Node(String val)
{
// Call the other (sister) constructor.
this(val, null);
}
}
  
private Node first; // list head
private Node last; // last element in list
  
  
public LinkedList1()
{
first = null;
last = null;
}
  
public boolean isEmpty()
{
return first == null;
}
  
public int size()
{
int count = 0;
Node p = first;
while (p != null)
{
// There is an element at p
count ++;
p = p.next;
}
return count;
}
  
public void add(String e)
{
if (isEmpty())
{
first = new Node(e);
last = first;
}
else
{
// Add to end of existing list
last.next = new Node(e);
last = last.next;
}
}
  
public void add(int index, String e)
{
if (index < 0 || index > size())
{
String message = String.valueOf(index);
throw new IndexOutOfBoundsException(message);
}
  
// Index is at least 0
if (index == 0)
{
// New element goes at beginning
first = new Node(e, first);
if (last == null)
last = first;
return;
}
  
  
Node pred = first;
for (int k = 1; k <= index - 1; k++)
{
pred = pred.next;
}
  
  
pred.next = new Node(e, pred.next);
  
  
if (pred.next.next == null)
last = pred.next;
}
  
public String toString()
{
StringBuilder strBuilder = new StringBuilder();
  
Node p = first;
while (p != null)
{
strBuilder.append(p.value + "\n");
p = p.next;
}
return strBuilder.toString();
}
  
public String remove(int index)
{
if (index < 0 || index >= size())
{
String message = String.valueOf(index);
throw new IndexOutOfBoundsException(message);
}
  
String element; // The element to return
if (index == 0)
{
// Removal of first item in the list
element = first.value;
first = first.next;
if (first == null)
last = null;
}
else
{
  
Node pred = first;
  
  
for (int k = 1; k <= index -1; k++)
pred = pred.next;
  
  
element = pred.next.value;
  
  
pred.next = pred.next.next;
  
  
if (pred.next == null)
last = pred;
}
return element;
}
  
public boolean remove(String element)
{
if (isEmpty())
return false;
  
if (element.equals(first.value))
{
  
first = first.next;
if (first == null)
last = null;
return true;
}
  
  
Node pred = first;
while (pred.next != null &&
!pred.next.value.equals(element))
{
pred = pred.next;
}
  
  
if (pred.next == null)
return false;
  
  
pred.next = pred.next.next;
  
// Check if pred is now last
if (pred.next == null)
last = pred;
  
return true;
}

LinkedList1Demo:

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.util.*;


/**
This class is used to demonstrate
the operations in the LinkedList1 class.
*/


public class LinkedList1Demo extends JFrame
{   
private LinkedList1 ll;
private JTextArea listView;
private JTextField cmdTextField;
private JTextField resultTextField;
  
public LinkedList1Demo()
{
ll = new LinkedList1();
listView = new JTextArea();
cmdTextField = new JTextField();
resultTextField = new JTextField();
  
// Create a panel and label for result field
JPanel resultPanel = new JPanel(new GridLayout(1,2));
resultPanel.add(new JLabel("Command Result"));
resultPanel.add(resultTextField);
resultTextField.setEditable(false);
add(resultPanel, BorderLayout.NORTH);
  
// Put the textArea in the center of the frame
add(listView);
listView.setEditable(false);
listView.setBackground(Color.WHITE);
  
// Create a panel and label for the command text field
JPanel cmdPanel = new JPanel(new GridLayout(1,2));
cmdPanel.add(new JLabel("Command:"));
cmdPanel.add(cmdTextField);
add(cmdPanel, BorderLayout.SOUTH);  
cmdTextField.addActionListener(new CmdTextListener());
  
// Set up the frame
setTitle("Linked List Demo");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
pack();
setVisible(true);
}
  
/**
Private class that responds to the command that
the user types into the command entry text field.
*/
  
private class CmdTextListener
implements ActionListener
{   
public void actionPerformed(ActionEvent evt)
{
String cmdText = cmdTextField.getText();
Scanner sc = new Scanner(cmdText);
String cmd = sc.next();
if (cmd.equals("add"))
{
if (sc.hasNextInt())
{
// add index element
int index = sc.nextInt();
String element = sc.next();
ll.add(index, element);   
}
else
{  
// add element
String element = sc.next();
ll.add(element);   
}
listView.setText(ll.toString());
pack();
return;
}
if (cmd.equals("remove"))
{
if (sc.hasNextInt())
{
// remove index
int index = sc.nextInt();
String res = ll.remove(index);
resultTextField.setText(res);   
}
else
{
// remove element
String element = sc.next();
boolean res = ll.remove(element);
String resText = String.valueOf(res);
resultTextField.setText(resText);
}
listView.setText(ll.toString());
pack();
return;
}
if (cmd.equals("isempty"))
{
String resText = String.valueOf(ll.isEmpty());
resultTextField.setText(resText);
return;
}
if (cmd.equals("size"))
{
String resText = String.valueOf(ll.size());
resultTextField.setText(resText);
return;
}
}
}
  
/**
The main method creates an instance of the
LinkedList1Demo class which causes it to
display its window.
*/
  
public static void main(String [ ] args)
{
new LinkedList1Demo();
}   
}

In: Computer Science

(JAVA) I have posted the same question 2 days ago, but it still has not solved...

(JAVA)

I have posted the same question 2 days ago, but it still has not solved yet.

I have "cannot be resolved or is not a field" error on

node.right; & node.left; under BuildExpressTree.java

//Main.java

import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import java.io.*;
import java.util.*;

public class Main extends JFrame{
   private GridLayout glm = new GridLayout(3, 1, 5, 20);
   private JPanel jp1 = new JPanel();
   private JPanel jp2 = new JPanel();
   private JPanel jp3 = new JPanel();
   private GridLayout gl1 = new GridLayout (1, 2);
   private JLabel jl1 = new JLabel("Enter Postfix Expression", JLabel.CENTER);
   private JTextField jtf1 = new JTextField();
   private GridLayout gl2 = new GridLayout(1, 3, 5, 9);
   private JButton jbEvaluate = new JButton("Construct Tree");
   private GridLayout gl3 = new GridLayout(1, 2);
   private JLabel jl2 = new JLabel("Infix Expression", JLabel.CENTER);
   private JTextField jtf2 = new JTextField();
   private String postfixExpression;
   private int result;
  
   public String userInput(){
       return (String)jtf1.getText();
   }
  
   public Main(){
       setTitle("Infix Expression Evaluator");
       setSize(500, 200);
       setLayout(glm);
       jp1.setLayout(gl1);
       jp1.add(jl1);
       jp1.add(jtf1);
       add(jp1);
       jp2.setLayout(gl2);
       jp2.add(new JLabel(""));
       jp2.add(jbEvaluate);
       jbEvaluate.addActionListener(new EnterActionListener());
       jp2.add(new JLabel(""));
       add(jp2);
       jp3.setLayout(gl3);
       jp3.add(jl2);
       jp3.add(jtf2);
       jtf2.setEditable(false);
       jtf2.setBackground(Color.PINK);
       add(jp3);
       setLocationRelativeTo(null);
       setResizable(true);
       setVisible(true);
       setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
   }

   class EnterActionListener implements ActionListener{
       public void actionPerformed(ActionEvent ae){
           jtf2.setText("");
           String result = "";
          
           try{
               result = BuildExpressionTree.constructTree(userInput());
               jtf2.setText(result);
               }catch(NumberFormatException nfe){
                   JOptionPane.showMessageDialog(null, "Amount must be numeric value", "Deposit Error", JOptionPane.WARNING_MESSAGE);
           }catch(EmptyStackException ese){
               JOptionPane.showMessageDialog(null, "Provide Expression to Calculate", "No Expression", JOptionPane.WARNING_MESSAGE);
           }
       }
       }
  
   public static void main (String[] args){
       Main main = new Main();
   }
}

//BuildExpressionTree.java

import java.util.*;
import javax.swing.*;
import javax.xml.soap.Node;

public class BuildExpressionTree {
   private static Stack<Node> stack = new Stack<Node>();
   private static Node node;
  
   public static boolean isOperator(String token){
       if(token == "+" || token == "-" || token == "*" || token == "/"){
           return true;
       }
       JOptionPane.showMessageDialog(null, "Invalid token" + token, "Token Error", JOptionPane.WARNING_MESSAGE);
       return false;
   }
  
   public static boolean isInteger(String token){
       try{
           if(Integer.parseInt(token) == 0 ||
           Integer.parseInt(token) == 1 ||
           Integer.parseInt(token) == 2 ||
           Integer.parseInt(token) == 3 ||
           Integer.parseInt(token) == 4 ||
           Integer.parseInt(token) == 5 ||
           Integer.parseInt(token) == 6 ||
           Integer.parseInt(token) == 7 ||
           Integer.parseInt(token) == 8 ||
           Integer.parseInt(token) == 9){
           return true;
           }
       }catch(NumberFormatException nfe){
           JOptionPane.showMessageDialog(null, "Invalid token" + token, "Token Error", JOptionPane.WARNING_MESSAGE);
           return false;
       }
       return true;
   }
  
   public static String[] postfixExpression(String postfixExp){
       String expression = postfixExp;
       String[] expressionArray = expression.split("\\s+");
       String splitExpression = "";
      
       for(int i = 0; i < expressionArray.length; i++){
           splitExpression += expressionArray[i];
       }
       StringTokenizer tokenizedExpression = new StringTokenizer(splitExpression);
       splitExpression = "";
      
       while(tokenizedExpression.hasMoreTokens()){
           String nextToken = tokenizedExpression.nextToken();
           splitExpression += nextToken + " ";
       }String[] tokens = splitExpression.split("\\s+");
       return tokens;
   }
  
   public static String constructTree(String expression) throws RuntimeException{
       stack = new Stack<Node>();
       String result;
       String[] expressionRead = postfixExpression(expression);
       for(int i = 0; i < expressionRead.length; i++){
           String nextToken = expressionRead[i];
           if(isInteger(nextToken)){
               node = (Node) new OperandNode(nextToken);
               stack.push(node);
           }else if(isOperator(nextToken)){
               node = (Node) new OperatorNode(nextToken);
               Node y;
               Node x;
              
               y = (Node) stack.pop();
               x = (Node) stack.pop();
              
               node.right = y;
               node.left = x;

               stack.push(node);
           }else{
               throw new RuntimeException();
           }
       }
       result = stack.peek().toString();
       return result;
   }
}

//Node.java


public abstract class Node {
   protected String data;
   protected Node left;
   protected Node right;
  
   public void setData(String data){
       this.data = data;
   }
  
   public String getData(){
       return data;
   }
}

class OperandNode extends Node{
   public OperandNode(String operand){
       this.data = operand;
       this.left = null;
       this.right = null;
   }
   public String toString(){
       return data + "";
   }
}

class OperatorNode extends Node{
   public OperatorNode(String operator){
       this.data = operator;
       this.left = null;
       this.right = null;
   }
  
   public void setLeft(Node left){
       this.left = left;
   }
   public Node getLeft(){
       return left;
   }
   public void setRight(Node right){
       this.right = right;
   }
   public Node getRight(){
       return right;
   }
   public String toString(){
       return "( " + this.left + " " + data + this.right + " )";
   }
}

In: Computer Science

For the first part of this lab, copy your working ArrayStringList code into the GenericArrayList class.(already...

For the first part of this lab, copy your working ArrayStringList code into the GenericArrayList class.(already in the code) Then, modify the class so that it can store any type someone asks for, instead of only Strings. You shouldn't have to change any of the actual logic in your class to accomplish this, only type declarations (i.e. the types of parameters, return types, etc.)

Note:

In doing so, you may end up needing to write something like this (where T is a generic type):

T[] newData = new T[capacity]; 

...and you will find this causes a compiler error. This is because Java dislikes creating new objects of a generic type. In order to get around this error, you can write the line like this instead:

T[] new Data = (T[]) new Object[capacity] 

This creates an array of regular Objects which are then cast to the generic type. It works and it doesn't anger the Java compiler. How amazing!

Once you're done, screenshot or save your code for checkin later.

For the second part of the lab, modify your GenericArrayList so that it can store any type that is comparable to a Point. Remember the Point and Point3D classes? Both of those implement the Comparable<Point> interface, so they both can compared to a Point. In fact, they are the only classes that can be compared to a Point, so after modifying your GenericArrayList, it should only be able to contain these two classes.

In both parts, test your classes by following the directions in the comments. They will ask you to uncomment some code and look for a specific result.

public class GenericArrayList {

/* YOUR CODE HERE

   * Copy your code from your ArrayStringList class, and place it within

   * this class.

   *

   * Only copy the code you filled out! Don't copy the main method.

   */

   // Place code here

public class ArrayStringList {

private String[] data;

private int size;

private void resizeData(int newSize) {

String[] str = new String[newSize];

for(int i = 0; i < size; i++) {

str[i] = data[i];

}

data=str;

}

public ArrayStringList(int initialCapacity) {

data = new String[initialCapacity];

size = 0;

}

public void add(String str) {

if(size < data.length) {

data[size] = str;

size++;

} else {

resizeData(2 * data.length);

data[size] = str;

size++;

}

}

public void add(int index, String str) {

if(index < data.length && index >= 0) {

data[index] = str;

size++;

}

}

public String get(int index) {

if(index < data.length && index >= 0) {

return data[index];

}

return null;

}

public void remove(int index) {

if(index < data.length && index >= 0) {

for(int i = index; i < data.length; i++) {

if((i + 1) < size) {

data[i] = data[i + 1];

}

}

size--;

}

}

public int size() {

return size;

}

public boolean contains(String str) {

for(int i = 0; i < data.length; i++) {

if(str.equals(data[i])) {

return true;

}

}

return false;

}

public static void main(String[] args) {

/* PART 1:

   * Modify the GenericArrayList above so that it can store *any* class,

   * not just strings.

   * When you've done that, uncomment the block of code below, and see if

   * it compiles. If it does, run it. If there are no errors, you did

   * it right!

   */

GenericArrayList<Point> pointList = new GenericArrayList<Point>(2);

pointList.add(new Point(0, 0));

pointList.add(new Point(2, 2));

pointList.add(new Point(7, 0));

pointList.add(new Point(19.16f, 22.32f));

pointList.remove(0);

Point p = pointList.get(2);

if (p.x != 19.16f && p.y != 22.32f) {

throw new AssertionError("Your GenericArrayList compiled properly "

+ "but is not correctly storing things. Make sure you didn't "

+ "accidentally change any of your ArrayStringList code, aside "

+ "from changing types.");

}

GenericArrayList<Float> floatList = new GenericArrayList<Float>(2);

for (float f = 0.0f; f < 100.0f; f += 4.3f) {

floatList.add(f);

}

float f = floatList.get(19);

System.out.println("Hurray, everything worked!");

  

/* PART 2:

   * Now, modify your GenericArrayList again so that it can only store

   * things that are comparable to a Point.

   *

   * If you don't know how to do this, reference zybooks and your textbook

   * for help.

   *

   * When you are ready to test it, uncomment the code above and run the

   * code below.

   */

/*

GenericArrayList<Point> pointList = new GenericArrayList<Point>(2);

GenericArrayList<Point3D> pointList3D = new GenericArrayList<Point3D>(3);

pointList.add(new Point(0, 0));

pointList.add(new Point(2, 2));

pointList.add(new Point(7, 0));

pointList.add(new Point(19.16f, 22.32f));

pointList3D.add(new Point3D(1.0f, 2.0f, 3.0f));

pointList3D.add(new Point3D(7.3f, 4, 0));

Point p = pointList.get(2);

Point3D p3 = pointList3D.get(0);

// You should get a compilation error on this line!

GenericArrayList<Float> floatList = new GenericArrayList<Float>(2);

*/

}

}

}

In: Computer Science

10. A researcher claims that the mean rate of individuals below poverty in the City of...

10. A researcher claims that the mean rate of individuals below poverty in the City of Chicago is below 17 %. Based on the data represented for the years 2005 – 2011, perform a hypothesis test to test his claim using a significance level of α = 0.10.

11. Would your conclusion change for question 10 if you used a significance level of α = 0.05? Explain.

12. A survey conducted at Chicago Public Schools (CPS) involving high school students on whether they had participated in binged drinking during the past month. Binge drinking was defined as 5 or more drinks in a row on one or more of the past 30 days.

Number who identified as having participated in Binge Drinking.

72

Total participants

567

a. From the sample data is there evidence that the proportion of students who participate in binge drinking is greater than 10%? Write a null and alternative hypothesis and perform an appropriate significance test using α=0.05.

b. Construct a 90% Confidence Interval for the population proportion. Does it support the same conclusion as in 12a? Explain.

Community Area Community Area Name Below Poverty Level Crowded Housing Dependency No High School Diploma Per Capita Income Unemployment
1 Rogers Park 22.7 7.9 28.8 18.1 23714 7.5
2 West Ridge 15.1 7 38.3 19.6 21375 7.9
3 Uptown 22.7 4.6 22.2 13.6 32355 7.7
4 Lincoln Square 9.5 3.1 25.6 12.5 35503 6.8
5 North Center 7.1 0.2 25.5 5.4 51615 4.5
6 Lake View 10.5 1.2 16.5 2.9 58227 4.7
7 Lincoln Park 11.8 0.6 20.4 4.3 71403 4.5
8 Near North Side 13.4 2 23.3 3.4 87163 5.2
9 Edison Park 5.1 0.6 36.6 8.5 38337 7.4
10 Norwood Park 5.9 2.3 40.6 13.5 31659 7.3
11 Jefferson Park 6.4 1.9 34.4 13.5 27280 9
12 Forest Glen 6.1 1.3 40.6 6.3 41509 5.5
13 North Park 12.4 3.8 39.7 18.2 24941 7.5
14 Albany Park 17.1 11.2 32.1 34.9 20355 9
15 Portage Park 12.3 4.4 34.6 18.7 23617 10.6
16 Irving Park 10.8 5.6 31.6 22 26713 10.3
17 Dunning 8.3 4.8 34.9 18 26347 8.6
18 Montclaire 12.8 5.8 35 28.4 21257 10.8
19 Belmont Cragin 18.6 10 36.9 37 15246 11.5
20 Hermosa 19.1 8.4 36.3 41.9 15411 12.9
21 Avondale 14.6 5.8 30.4 25.7 20489 9.3
22 Logan Square 17.2 3.2 26.7 18.5 29026 7.5
23 Humboldt Park 32.6 11.2 38.3 36.8 13391 12.3
24 West Town 15.7 2 22.9 13.4 39596 6
25 Austin 27 5.7 39 25 15920 21
26 West Garfield Park 40.3 8.9 42.5 26.2 10951 25.2
27 East Garfield Park 39.7 7.5 43.2 26.2 13596 16.4
28 Near West Side 21.6 3.8 22.9 11.2 41488 10.7
29 North Lawndale 38.6 7.2 40.9 30.4 12548 18.5
30 South Lawndale 28.1 17.6 33.1 58.7 10697 11.5
31 Lower West Side 27.2 10.4 35.2 44.3 15467 13
32 Loop 11.1 2 15.5 3.4 67699 4.2
33 Near South Side 11.1 1.4 21 7.1 60593 5.7
34 Armour Square 35.8 5.9 37.9 37.5 16942 11.6
35 Douglas 26.1 1.6 31 16.9 23098 16.7
36 Oakland 38.1 3.5 40.5 17.6 19312 26.6
37 Fuller Park 55.5 4.5 38.2 33.7 9016 40
38 Grand Boulevard 28.3 2.7 41.7 19.4 22056 20.6
39 Kenwood 23.1 2.3 34.2 10.8 37519 11
40 Washington Park 39.1 4.9 40.9 28.3 13087 23.2
41 Hyde Park 18.2 2.5 26.7 5.3 39243 6.9
42 Woodlawn 28.3 1.8 37.6 17.9 18928 17.3
43 South Shore 31.5 2.9 37.6 14.9 18366 17.7
44 Chatham 25.3 2.2 40 13.7 20320 19
45 Avalon Park 16.7 0.6 41.9 13.3 23495 16.6
46 South Chicago 28 5.9 43.1 28.2 15393 17.7
47 Burnside 22.5 5.5 40.4 18.6 13756 23.4
48 Calumet Heights 12 1.8 42.3 11.2 28977 17.2
49 Roseland 19.5 3.1 40.9 17.4 17974 17.8
50 Pullman 20.1 1.4 42 15.6 19007 21
51 South Deering 24.5 6 41.4 21.9 15506 11.8
52 East Side 18.7 8.3 42.5 35.5 15347 14.5
53 West Pullman 24.3 3.3 42.2 22.6 16228 17
54 Riverdale 61.4 5.1 50.2 24.6 8535 26.4
55 Hegewisch 12.1 4.4 41.6 17.9 22561 9.6
56 Garfield Ridge 9 2.6 39.5 19.4 24684 8.1
57 Archer Heights 13 8.5 40.5 36.4 16145 14.2
58 Brighton Park 23 13.2 39.8 48.2 13138 11.2
59 McKinley Park 16.1 6.9 33.7 31.8 17577 11.9
60 Bridgeport 17.3 4.8 32.3 25.6 24969 11.2
61 New City 30.6 12.2 42 42.4 12524 17.4
62 West Elsdon 9.8 8.7 38.7 39.6 16938 13.5
63 Gage Park 20.8 17.4 40.4 54.1 12014 14
64 Clearing 5.9 3.4 36.4 18.5 23920 9.6
65 West Lawn 15.3 6.8 41.9 33.4 15898 7.8
66 Chicago Lawn 22.2 6.5 40 31.6 14405 11.9
67 West Englewood 32.3 6.9 40.9 30.3 10559 34.7
68 Englewood 42.2 4.8 43.4 29.4 11993 21.3
69 Greater Grand Crossing 25.6 4.2 42.9 17.9 17213 18.9
70 Ashburn 9.5 4.2 36.7 18.3 22078 8.8
71 Auburn Gresham 24.5 4.1 42.1 19.5 16022 24.2
72 Beverly 5.2 0.7 38.7 5.1 40107 7.8
73 Washington Heights 15.7 1.1 42.4 15.6 19709 18.3
74 Mount Greenwood 3.1 1.1 37 4.5 34221 6.9
75 Morgan Park 13.7 0.8 39.4 10.9 26185 14.9
76 O'Hare 9.5 1.9 26.5 11 29402 4.7
77 Edgewater 16.6 3.9 23.4 9 33364 9

In: Statistics and Probability

1-What are the Major Risks Tom and Nancy face? 2-What different insurance products do they need?...

1-What are the Major Risks Tom and Nancy face? 2-What different insurance products do they need? 3-How much insurance should they carry? 4-If Life Insurance is recommended, what policy value? Question:Tom and Nancy Smith are married, with 2 children •Nancy is 38, Tom 42 •Both have active lifestyles •They ski and snowmobile in the winter •Their children, Emily and Brian, are 6 and 8 respectively •Nancy is a CPA at a local accounting firm ($150K annual salary) •Hank teaches at the local high school ($85K) Assets •Three bedroom home worth $500K •Two SUVs •Snowmobiles Case Study - Insurance Long Term Goals for the Smiths. •Income Replacement in case of the death of either Tom or Nancy •College for their children •Retirement Income is covered by Tom and Nancy's Employment

1-What are the Major Risks Tom and Nancy face?

2-What different insurance products do they need?

3-How much insurance should they carry?

4-If Life Insurance is recommended, what policy value?

In: Finance

imagine, or maybe you have been, that you are on an Ethics Committee at a large...

imagine, or maybe you have been, that you are on an Ethics Committee at a large hospital. “Your committee must make a very important decision. Seven patients (A. - G.) need a heart transplant. There is only one heart donor at this time. All of the patients are eligible to receive this heart. All are physically able. And all have compatible tissue and blood typing.”
Patient Waiting List:
A. 31 year old male; African American, brain surgeon at the height of his career; no children
B. 12 year old female; Vietnamese; accomplished violinist; blind
C. 40 year old male; Hispanic, teacher, 2 children
D. 15 year old female; White, unmarried, 6 months pregnant
E. 35 year old male; Hispanic; Roman Catholic priest
F. 17 year old female; White; waitress; high school dropout; supports/cares for a brother who is severely disabled
G. 38 year old female; White; AIDS researcher; no children; lesbian

In: Nursing

Mary Guilott recently graduated from Nichols State University and is anxious to begin investing her meager savings as a way of applying what she has learned in business school

Mary Guilott recently graduated from Nichols State University and is anxious to begin investing her meager savings as a way of applying what she has learned in business school. Specifically, she is evaluating an investment in a portfolio comprised of two firms' common stock. She has collected the following information about the common stock of Firm A and Firm B:


Expected ReturnStandard Deviation
Firm A's Common Stock0.150.18
Firm B's Common Stock0.160.22
Correlation Coefficient0.7

a. If Mary decides to invest 50% of her money in Firm A's common stock and 50% in Firm B's common stock and the correlation between the two stocks is 0.70, then the expected rate of return in the portfolio is

b. Answer part a where the correlation between the two common stock investments is equal to zero.

c. Answer part a where the correlation between the two common stock investments is equal to +1.

d. Answer part a where the correlation between the two common stock investments is equal to −1.

In: Finance

Question 1. A snowboard company currently hires 10 skilled employees who are paid a weekly wage...

Question 1. A snowboard company currently hires 10 skilled employees who are paid a weekly wage of $1000. The cost of capital $3,000 and it is fixed, which means that it does not vary with output. The company is currently producing 240 snowboards. The company's cost will be $13,500 if it produces an additional snowboard. A customer is willing to pay $550 for the 241st snowboard. Should the company produce and sell it? Explain. What core principles should be considered in the snowboard company's decision making? (i) Scarcity, choice, and opportunity cost (ii) Cost-benefit analysis (iii) Incentive principle (iv) Diminishing returns

Question 2. Timothy quits his job, which pays $60,000 a year, to enrol in a 2-year graduate program. His annual school expenses are $60,000 for tuition, $8,000 for books, and $1,400 for food. What is his opportunity cost of attending the graduate program? What core principles are considered in Timothy's decision making? (i) Scarcity, choice, opportunity cost (ii) Cost-benefit analysis (iii) Incentive principle (iv) Diminishing returns

In: Economics

It is widely accepted that spending money to promote healthy lifestyles and prevent health problems makes...

It is widely accepted that spending money to promote healthy lifestyles and prevent health problems makes good economic sense.  Epidemiologists often measure if the money spent implementing a health promotion program is economically worth the outcomes – i.e. – is it cost-beneficial (does it save money)?  This analysis, called a CBA, is often reported as ROI – Return on Investment.

Create a hypothetical intervention program that you believe would result in a positive ROI in a workplace, school, community organization, or clinical setting.  Project your expected costs (investment) of the program (you may keep it brief – use 3-5 line items that you think might be reasonable and expected costs of implementing your program).  Then project the savings (benefits) of your investment (again hypothetically create a cost-saving using 2-3 line items).  Show your work using the ROI equation.  Do you think your program would result in a ROI greater than one?  Why did you select this particular health promotion program?

In: Nursing

8. Price discrimination can occur If: a.) producers are price takers b.) there are many firms...

8. Price discrimination can occur If:
a.) producers are price takers
b.) there are many firms in the industry, all producing the same identical good.
c.) the market structure is monopolistic competition.
d.) all consumers have the same willingness to pay for the good.

10. The Go Sports Company is a profit-maximizing firm with a monopoly in the production of school team pennants. The firm sells its pennants for $10 each. We can conclude that Go Sport is producing a level of output at which:
a.) average total cost is greater than $10.
b.) average total cost equals $10.
c.) marginal revenue equals $10.
d.) marginal cost equals marginal revenue.

14. The demand curve for monopoly is:
a.) the entire MR curve.
b.) the MR curve above the AVC curve.
c.) above the MR curve.
d.) the MR curve above the horizontal axis.

15. Price discrimination leads to a __ price for consumers with a ___ demand.
a.) higher; less elastic
b.) higher; perfectly elastic
c.) higher; more elastic
d.) lower; less elastic

In: Economics