Turn the following code into a chat system that can send messages CONTINUOSLY without the the other side needing to a response. Use a send and receive thread to allow this.
Client Side:
package com.company;
import java.io.IOException;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.net.InetAddress;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
byte[] receiveBytes = new byte[256];
final String TERMINATE = "bye";
final int SERVER_PORT = 8080;
System.out.println("Client started. Type a message and hit Enter key to send the message to server.");
try (Scanner sc = new Scanner(System.in); DatagramSocket ds = new DatagramSocket();) {
// Get server address
final InetAddress SERVER_ADDRESS = InetAddress.getLocalHost();
DatagramPacket dataPacket = null;
while (!ds.isClosed()) {
String input = sc.nextLine();
// Terminate the client if user says "bye"
if (input.trim().equalsIgnoreCase(TERMINATE)) {
break;
}
// Construct Datagram packet to send message
dataPacket = new DatagramPacket(input.getBytes(), input.getBytes().length, SERVER_ADDRESS, SERVER_PORT);
ds.send(dataPacket);
// Construct Datagram packet to receive message
dataPacket = new DatagramPacket(receiveBytes, receiveBytes.length);
ds.receive(dataPacket);
System.out.println("Server Says:" + new String(receiveBytes, "UTF-8"));
}
} catch (SocketException | UnknownHostException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Server side:
package com.company;
import java.net.DatagramPacket;
import java.net.DatagramSocket;
import java.util.Scanner;
import java.net.InetAddress;
public class Main {
public static void main(String[] args) {
InetAddress ip;
String hostname;
byte[] receiveBytes = new byte[256];
final int SERVER_PORT = 8080;
try (DatagramSocket ds = new DatagramSocket(SERVER_PORT); Scanner sc = new Scanner(System.in);) {
ip = InetAddress.getLocalHost();
hostname = ip.getHostName();
System.out.println("Your current IP address : " + ip);
System.out.println("Your current Hostname : " + hostname);
System.out.println("Your current Port : " + SERVER_PORT);
System.out.println("Server started. Waiting for client message...");
while (!ds.isClosed()) {
// Construct Datagram packet to receive message
DatagramPacket dp = new DatagramPacket(receiveBytes, receiveBytes.length);
ds.receive(dp);
String dataString = new String(dp.getData(), "UTF-8");
System.out.println("Client Says:" + dataString);
String input = sc.nextLine();
// Construct Datagram packet to send message
DatagramPacket sendPacket = new DatagramPacket(input.getBytes(), input.getBytes().length,
dp.getAddress(), dp.getPort());
ds.send(sendPacket);
}
ds.close();
} catch (Exception e) {
e.printStackTrace();
}
}
}
In: Computer Science
This dataset has four features as follows: author, thread, length, and where to read the mail. According to the features the algorithm has to predict the user’s action whether to read or skip the mail.
Use Naïve Bayes classifier to predict the user’s action (skips or reads) when the author of the mail is known, the thread of the mail is follow up, the length of the mail is short, and where to read the email is home.
|
Author |
Thread |
Length |
Where to read |
User’s Action |
|
Known |
new |
long |
home |
Skips |
|
unknown |
new |
short |
work |
Reads |
|
unknown |
Follow up |
long |
work |
Skips |
|
Known |
Follow up |
Long |
Home |
Skips |
|
Known |
New |
Short |
Home |
Reads |
|
Known |
Follow up |
Long |
Work |
Skips |
|
Unknown |
New |
short |
work |
skips |
|
Unknown |
New |
short |
Work |
reads |
|
Known |
Follow up |
Long |
Home |
Skips |
|
known |
New |
Long |
Work |
skips |
|
unknown |
Follow up |
short |
home |
Skips |
|
Known |
new |
Long |
work |
Skips |
|
Known |
Follow up |
Short |
Home |
Reads |
|
Known |
New |
Short |
Work |
Reads |
|
known |
New |
short |
Home |
Reads |
|
Known |
Follow up |
short |
Work |
Reads |
|
Known |
New |
Short |
home |
Reads |
|
unknown |
new |
short |
work |
Reads |
Hint in authors feature you can use 0, 1 instead of unknown and known. In thread feature you can use 0, 1 instead of follow up and new. In length feature you can use 0, 1 instead of short and long. In where to read feature you can use 0, 1 instead of home, work. In the target you can use 0 instead of skips and 1 instead of reads.
In: Computer Science
Shelly's Boutiques and Crafts had revenue of $5,700,000 this year on sales of 575,000 units. Variable costs were 35% and fixed costs totaled $3,150,000. Although the first five years were relatively profitable, increases in competition have led to a negative trend in profitability that has led them to the point where they have to make some changes to stay afloat. The company is evaluating two options to stay afloat.
Option 1: Purchase machinery to automate their operations. this machinery cost $625,000 but will decrease variable costs by 9%
Option 2: Outsource the production of one of their main components that requires a substantial amount of machinery and skilled labor. This will reduce fixed costs by $425,000, but increases variable costs from their current 35% of sales to 40% of sales.
a. determine break even points in units before changes. what is fixed cost total? what is the contribution margin per unit? what is the break even point in units?
b.) Assuming an income tax rate of 35%, what dollar value of sales is required to earn an after tax profit of $800,000 What before tax profit would be needed to earn an after tax profit of $800,000? what is the contribution margin raton? What dollar amount of sales would be required to earn the after tax profit described above?
c.) Calculate the operating leverage before applying any of the options: What is the contribution margin in Total? What is the operating income in total? what is the operating leverage factor?
d.) Calculate the break even point in units after applying Option 1: What is the new fixed cost in total? What is the new contribution margin per unit? What is the new break even point in units?
e.) Calculate the operating leverage after applying Option 1: What is the new contribution margin in Total? What is the new operating income in total? what is the new operating leverage factor?
f.) Calculate the break even point in units after applying Option 2: What is the new fixed cost in total? What is the new contribution margin per unit? What is the new break even point in units?
g.) Calculate the operating leverage after applying Option 2: What is the new contribution margin in Total? What is the new operating income in total? what is the new operating leverage factor?
In: Finance
In: Economics
|
“I know headquarters wants us to add that new product line,” said Fred Halloway, manager of Kirsi Products’ East Division. “But I want to see the numbers before I make a move. Our division’s return on investment (ROI) has led the company for three years, and I don’t want any letdown.” |
|
Kirsi Products is a decentralized wholesaler with four autonomous divisions. The divisions are evaluated on the basis of ROI, with year-end bonuses given to divisional managers who have the highest ROI. Operating results for the company’s East Division for last year are given below: |
| Sales | $ | 27,000,000 |
| Variable expenses | 14,000,000 | |
| Contribution margin | 13,000,000 | |
| Fixed expenses | 10,759,000 | |
| Net operating income | $ | 2,241,000 |
| Divisional operating assets | $ | 6,000,000 |
|
The company had an overall ROI of 18% last year (considering all divisions). The company’s East Division has an opportunity to add a new product line that would require an investment of $2,900,000. The cost and revenue characteristics of the new product line per year would be as follows: |
| Sales | $ 8,120,000 |
| Variable expenses | 65% of sales |
| Fixed expenses | $ 2,281,720 |
| Required: | |
| 1. |
Compute the East Division’s ROI for last year; also compute the ROI as it would appear if the new product line is added. (Round your intermediate calculations and final answers to 2 decimal places. Omit the "%" sign in your response.) |
| ROI | |
| Present | % |
| New product line alone | % |
| Total | % |
| 2. | If you were in Fred Halloway’s position, would you accept or reject the new product line? |
|
| 3. | Why do you suppose headquarters is anxious for the East Division to add the new product line? |
|
| 4. | Suppose that the company’s minimum required rate of return on operating assets is 15% and that performance is evaluated using residual income. |
| a. | Compute the East Division’s residual income for last year; also compute the residual income as it would appear if the new product line is added. (Omit the "$" sign in your response.) |
| Residual income | |
| Present | $ |
| New product line alone | $ |
| Total | $ |
| b. | Under these circumstances, if you were in Fred Halloway's position would you accept or reject the new product line? |
|
In: Accounting
1. The following data represent the scores on a test for 36
students in a Sociology class, followed by a stem plot for the
data.
65 76 83 81 74 78 41 57 82 50 90 81 63 68 80 85 76 73 79 48 80 75
72 70 75 74 94 87 81 78 64 83 77 72 79 86
4 1 8 5 0 7 6 3 4 5 8 7 0 2 2 3 4 4 5 5 6 6 7 8 8 9 9 8 0 0 1 1 1 2
3 3 5 6 7 9 0 4
X = ______________________________________________________
ON ALL OF THE FOLLOWING PROBLEMS, SHOW ALL WORK AND LABEL YOUR
ANSWERS WITH THE APPROPRIATE UNITS. LABEL ALL AXES ON ANY
GRAPHS.
a. Find: median mode(s) range
-------------------------------------------------------------------------------------------------------------------------------------------
b. Find and interpret the value for Q1. Show all work.
value of Q1 interpretation
-------------------------------------------------------------------------------------------------------------------------------------------
c. Find the values ONLY of Q3 and P85. Show all work.
value of Q3 value of P85
(#1 cont’d)
!!!! DON’T FORGET TO PUT UNITS ON YOUR ANSWERS AND LABEL AXES ON
GRAPHS !!!!
d. Give a five-number summary e. Construct a box plot for the test
scores. for the test scores.
position value
__________ _____________
__________ _____________
__________ _____________
__________ _____________
_____________________________________________
__________ _____________
-----------------------------------------------------------------------------------------------------------------------------------------------
f. Calculate the fences and list the outlier(s) in this set of
scores. Construct a modified box plot to clearly show the
outlier(s).
calculations lower fence ___________
upper fence ___________
outliers ________________
--------------------------------------------------------------------------------------------------------------------------------------------
g. Construct a modified box plot to clearly show the outlier(s).
Label ALL critical positions with their corresponding values.
___________________________________________________________________
2. A random sample of 8 of the tests was chosen and their scores
are given below. Calculate the sample mean, the sample variance and
the sample standard deviation. Show all work.
78 64 81 75 50 85 79 72
mean
--------------------------------------------------------------------------------------------------------------------------------------------------
variance
--------------------------------------------------------------------------------------------------------------------------------------------------
standard deviation
3. The five number summary and the modified box plot for a set of
test scores are given below.
five number summary: 33 68 80 86 97
modified box plot: 68 80 86 33 38 40 44 _______________________
97
* * * | | _______________________
______________________________________________________________________________________
30 40 50 60 70 80 90 100 test scores
X =
_____________________________________________________________
a. What percent of the students scored at least an 86?
________________
b. What percent of the scores is between 33 and 80?
________________
c. The score of 80 is which of the following? mean median Q1
Q3
d. What percent of the scores is 80 or less? ________________
e. The minimum score for this distribution is ____________ and the
maximum is _____________ .
f. List all outliers. ___________________________________
g. What is the value of Q3? ______________
h. Find the fences. Show all work. lower _____________ upper
_____________
4. The average height of a 6th grade boy is 58 inches with a
standard deviation of 2 inches. The average height of a 9th grade
boy is 65 inches with a standard deviation of 3 inches. Both height
distributions are bell-shaped.
a. If a 9th grade boy is 60 inches, which of the following is true
based on the z-score for his height? Show work.
_____ His height is 1.67 inches below the mean. _____ His height is
1.67 inches above the mean. _____ His height is 1.67 standard
deviations below the mean. _____ His height is 1.67 standard
deviations above the mean.
--------------------------------------------------------------------------------------------------------------------------------------------------
b. If a 6th grade boy is 55 inches, which of the following is true
based on the z-score for his height? Show work.
_____ His height is 1.5 inches below the mean. _____ His height is
1.5 inches above the mean. _____ His height is 1.5 standard
deviations below the mean. _____ His height is 1.5 standard
deviations above the mean.
--------------------------------------------------------------------------------------------------------------------------------------------------
c. Who is taller for his age: the 55-inch tall 6th grade boy or the
60-inch tall 9th grade boy? _____ The 9th grader is taller because
his height is farther from the mean than the 6th grader’s. _____
The 9th grader is taller for his age because 60 inches is greater
than 55 inches. _____ The 6th grader is taller because his height
is closer to the mean than the 9th grader’s. _____ The 6th grader
is taller because his height is not as far below the mean as the
9th grader’s.
--------------------------------------------------------------------------------------------------------------------------------------------------
d. Using the Empirical Rule, approximately ______ percent of 9th
grade boys have heights between 59 inches and 71 inches. Show work
to support your answer.
--------------------------------------------------------------------------------------------------------------------------------------------------
e. Using the Empirical Rule, approximately 99.7% of 6th grade boys
fall between heights of _______________ and ______________. Show
work to support your answer
In: Statistics and Probability
Hey guys so ive been working on these Radix for quite sometime but I keep hitting roadblocks on my todos. Ive implement the first TODO but I cant get the stringRadixSort to work properly as well nor the ChainOfNodes mergeTwoChainsIntoThird() function. Please feel free to rewrite anything you see wrong with it. Ive also provided the Lab Description down below as well for what the output should be and what to do. Thanks again for your guys help!
1) Implement a radix sort of String objects in a chain of linked nodes, where strings consist only of upper-case characters. This sort will need 27 buckets: 26 for letters A to Z and one bucket for a space. Each bucket holds a ChainOfNodes object, which will hold appropriate Strings during the sorting.
2) The ChainOfNodes is a private class inside the SortChain class, its add method adds new elements to the end on the chain.
3) SortChain constructor is already defined and it calls a private method generateList that randomly generates the given number of String objects with number of characters no longer than the given maxStringLength and adds them to the given list. Utilize StringBuffer to build each String.
4) You will create two lists: this.linkedDataOne and this.linkedDataTwo. Each list will be sorted with the stringRadixSort method which you need to implement following the radix sort algorithm.
5) Finally, you will create a third list with mergeTwoChainsIntoThird method. The new list will contain the same data the this.linkedDataOne and this.linkedDataTwo contain. The new list will also be sorted in the ascending order and the original list will remain unchanged.
See sample runs (with seed 101):
RUN #1
How many nodes in the first chain?
It should be an integer value greater than or equal to 0.
5
How many characters in the longest string in the first chain?
It should be an integer value greater than or equal to 1.
6
How many nodes in the second chain?
It should be an integer value greater than or equal to 0.
7
How many characters in the longest string in the second chain?
It should be an integer value greater than or equal to 1.
3
The original listOne is:
CLYUD RWUMOX OVW A CEZ
The are 5 elements in the list
The longest string has 6 characters, so the number of needed passes is 6
The original listOne sorted with RadixSort:
A CEZ CLYUD OVW RWUMOX
The are 5 elements in the list
The original listTwo is:
AY NCQ UBT D TF A UAR
The are 7 elements in the list
The longest string has 3 characters, so the number of needed passes is 3
The original listTwo sorted with RadixSort:
A AY D NCQ TF UAR UBT
The are 7 elements in the list
The mergeChain is:
A A AY CEZ CLYUD D NCQ OVW RWUMOX TF UAR UBT
The are 12 elements in the list
The listOne sorted should be unchanged:
A CEZ CLYUD OVW RWUMOX
The are 5 elements in the list
The listTwo sorted should be unchanged:
A AY D NCQ TF UAR UBT
The are 7 elements in the list
Process finished with exit code 0
RUN #2
How many nodes in the first chain?
It should be an integer value greater than or equal to 0.
0
How many characters in the longest string in the first chain?
It should be an integer value greater than or equal to 1.
5
How many nodes in the second chain?
It should be an integer value greater than or equal to 0.
5
How many characters in the longest string in the second chain?
It should be an integer value greater than or equal to 1.
3
The original listOne is:
The list is empty
The original listOne sorted with RadixSort:
The list is empty
The original listTwo is:
CL UD RWU O S
The are 5 elements in the list
The longest string has 3 characters, so the number of needed passes is 3
The original listTwo sorted with RadixSort:
CL O RWU S UD
The are 5 elements in the list
The mergeChain is:
CL O RWU S UD
The are 5 elements in the list
The listOne sorted should be unchanged:
The list is empty
The listTwo sorted should be unchanged:
CL O RWU S UD
The are 5 elements in the list
Process finished with exit code 0
RUN #3
How many nodes in the first chain?
It should be an integer value greater than or equal to 0.
25
How many characters in the longest string in the first chain?
It should be an integer value greater than or equal to 1.
4
How many nodes in the second chain?
It should be an integer value greater than or equal to 0.
4
How many characters in the longest string in the second chain?
It should be an integer value greater than or equal to 1.
25
The original listOne is:
CLY D RWU OX OVWM MCE O Y NCQD BTQ WT GA UAR BNOZ KK H U JBAO DF DIN RYBA BMZG GFLU SJX X
The are 25 elements in the list
The longest string has 4 characters, so the number of needed passes is 4
The original listOne sorted with RadixSort:
BMZG BNOZ BTQ CLY D DF DIN GA GFLU H JBAO KK MCE NCQD O OVWM OX RWU RYBA SJX U UAR WT X Y
The are 25 elements in the list
The original listTwo is:
OAQTRHPCWYKQJLDVISONZN ORLBRYUSSXFNFQ YSLFLIASALCGMYBNXISCIJQ OPEMSYQVZUMCCVDS
The are 4 elements in the list
The longest string has 23 characters, so the number of needed passes is 23
The original listTwo sorted with RadixSort:
OAQTRHPCWYKQJLDVISONZN OPEMSYQVZUMCCVDS ORLBRYUSSXFNFQ YSLFLIASALCGMYBNXISCIJQ
The are 4 elements in the list
The mergeChain is:
BMZG BNOZ BTQ CLY D DF DIN GA GFLU H JBAO KK MCE NCQD O OAQTRHPCWYKQJLDVISONZN OPEMSYQVZUMCCVDS ORLBRYUSSXFNFQ OVWM OX RWU RYBA SJX U UAR WT X Y YSLFLIASALCGMYBNXISCIJQ
The are 29 elements in the list
The listOne sorted should be unchanged:
BMZG BNOZ BTQ CLY D DF DIN GA GFLU H JBAO KK MCE NCQD O OVWM OX RWU RYBA SJX U UAR WT X Y
The are 25 elements in the list
The listTwo sorted should be unchanged:
OAQTRHPCWYKQJLDVISONZN OPEMSYQVZUMCCVDS ORLBRYUSSXFNFQ YSLFLIASALCGMYBNXISCIJQ
The are 4 elements in the list
Process finished with exit code 0
import java.util.InputMismatchException;
import java.util.Random;
import java.util.Scanner;
/**
* A class Radix Sort tester
*
* @author YOUR NAME
* @version 10/6/2020
*/
public class SortChain>
{
private ChainOfNodes linkedDataOne;
private ChainOfNodes linkedDataTwo;
private Random generator;
public SortChain(int listSizeOne, int maxStringLengthOne, int listSizeTwo, int maxStringLengthTwo)
{
this.generator = new Random(101);
this.linkedDataOne = generateList(listSizeOne, maxStringLengthOne);
this.linkedDataTwo = generateList(listSizeTwo, maxStringLengthTwo);
}
/**
* Creates a ChainOfNodes object called list, randomly generates String objects and adds them to the list
*
* @param listSize - number of STring objects to generate
* @param maxStringLength - the maximum number of characters in the generated String object
* @return created list
*/
private ChainOfNodes generateList(int listSize, int maxStringLength)
{
final int ASCII_Z = 90;
final int ASCII_A = 65;
ChainOfNodes list = new ChainOfNodes<>();
//TODO Project 4 #1
for (int i = 0; i < listSize; i++)
{
StringBuilder builder = new StringBuilder();
int length = generator.nextInt (maxStringLength) + 1;
for (int j = 0; j < length; j++)
{
char c = (char) (generator.nextInt ((ASCII_Z - ASCII_A) + 1) + ASCII_A) ;
builder.append (c);
}
String word = builder.toString();
list.add (word);
}
return list;
}
public void sortLinkedDataAndDisplayResults()
{
System.out.println("\nThe original listOne is: ");
displayChain(this.linkedDataOne.firstNode);
stringRadixSort(this.linkedDataOne);
System.out.println("The original listOne sorted with RadixSort: ");
displayChain(this.linkedDataOne.firstNode);
System.out.println("\n\nThe original listTwo is: ");
displayChain(this.linkedDataTwo.firstNode);
stringRadixSort(this.linkedDataTwo);
System.out.println("The original listTwo sorted with RadixSort: ");
displayChain(this.linkedDataTwo.firstNode);
}
/**
* RADIX SORT
* sorts String objects in linkedData chain of nodes
*/
private void stringRadixSort(ChainOfNodes linkedData)
{
// TODO Project 4 #2
Node currentNode = linkedData.firstNode;
final int NUMBER_OF_UPPER_CASE_LETTERS = 26;
// do nothing if no more than one node
// otherwise
// create buckets
// traverse the chain to find the longest string
if (currentNode.next == null)
{
return;
}
Node[] buckets = new Node[NUMBER_OF_UPPER_CASE_LETTERS];
String longestString = currentNode.data;
while (currentNode != null)
{
if (currentNode.data.length () > longestString.length ())
{
longestString = currentNode.data;
}
currentNode = currentNode.next;
}
int max = longestString.length (); // THIS IS A STUB
System.out.println("\u001B[35m\u001B[1m The longest string has " + max + " characters so the number of needed passes is " + max + "\u001B[0m\n");
// start soring
// for each pass:
// distribute nodes to appropriate buckets
// clear the original chain and add the nodes back in "buckets" order
// clear buckets
for (int i = 0; i < max; i++)
{
currentNode = linkedData.firstNode;
int length = 1;
while (currentNode.data != null)
{
if (currentNode.data.length () > i)
{
int charValue = (int) (currentNode.data.charAt (i)) - 'A';
}
currentNode = currentNode.next;
length++;
}
linkedData.clear ();
}
}
public void createSortedChainFromTwoAndDisplayResults()
{
ChainOfNodes mergeChain = mergeTwoChainsIntoThird();
System.out.println("\n\u001B[35m\u001B[1mThe mergeChain is:\u001B[0m");
displayChain(mergeChain.firstNode);
System.out.println("The listOne sorted should be unchanged: ");
displayChain(this.linkedDataOne.firstNode);
System.out.println("The listTwo sorted should be unchanged: ");
displayChain(this.linkedDataTwo.firstNode);
}
/**
* Merges two sorted chains: this.linkedDataOne and this.linkedDataTwo into a new one
* and returns a reference to the new chain.
* Each chain is in ascending order.
* The resulting chain should be in ascending order
* The original chains remain unchanged
*/
private ChainOfNodes mergeTwoChainsIntoThird()
{
ChainOfNodes newChain = new ChainOfNodes<>();
Node firstCurrent = this.linkedDataOne.firstNode;
Node secondCurrent = this.linkedDataTwo.firstNode;
while ((firstCurrent != null) && (secondCurrent != null))
{
// TODO Project 4 #3
// Create new node for merged chain and decide what data belongs in it
} // end while
// Exhausted one or both chains; add any remaining data
return newChain;
}
/**
* Displays all entries in the given chain of nodes.
*/
private void displayChain(Node currentNode)
{
if (currentNode == null)
System.out.println("The list is empty");
else
{
int count = 0;
while (currentNode != null)
{
System.out.print(currentNode.data + " ");
count++;
currentNode = currentNode.next;
}
System.out.println("\nThe are " + count + " elements in the list");
}
}
/**
* Chain of nodes class with add method that adds elements to the end of the list
*/
private class ChainOfNodes>
{
private Node firstNode; // reference to first node
private Node tailNode; // reference to the last node in the chain
public ChainOfNodes()
{
this.firstNode = null;
this.tailNode = null;
} // end default constructor
/**
* Adds a new entry to the end of the chain.
*
* @param newEntry the object to be added as a new entry
* @return true
*/
public boolean add(T newEntry) // OutOfMemoryError possible
{
// add to the end of the chain:
Node newNode = new Node<>(newEntry);
if (this.firstNode == null)
{
this.firstNode = newNode;
this.tailNode = newNode;
}
else
{
this.tailNode.next = newNode;
this.tailNode = newNode;
}
return true;
} // end add
/**
* Removes all entries from this bag.
*/
public void clear()
{
this.firstNode = null;
this.tailNode = null;
} // end clear
} // end ChainOfNodes
private class Node
{
private S data; // entry in bag
private Node next; // link to next node
private Node(S dataPortion)
{
this(dataPortion, null);
} // end constructor
private Node(S dataPortion, Node nextNode)
{
this.data = dataPortion;
this.next = nextNode;
}
} // end Node
public static void main(String args[])
{
int listOneSize = 0;
int maxStringLengthListOne = 0;
int listTwoSize = 0;
int maxStringLengthListTwo = 0;
boolean invalidInput;
// get input
do
{
try
{
invalidInput = false;
Scanner keyboard = new Scanner(System.in);
System.out.println("How many nodes in the first chain?" + "\n It should be an integer value greater than or equal to 0.");
listOneSize = keyboard.nextInt();
System.out.println("How many characters in the longest string in the first chain?" + "\n It should be an integer value greater than or equal to 1.");
maxStringLengthListOne = keyboard.nextInt();
System.out.println("\nHow many nodes in the second chain?" + "\n It should be an integer value greater than or equal to 0.");
listTwoSize = keyboard.nextInt();
System.out.println("How many characters in the longest string in the second chain?" + "\n It should be an integer value greater than or equal to 1.");
maxStringLengthListTwo = keyboard.nextInt();
} catch (InputMismatchException ime)
{
System.out.println("Could not convert input to an integer");
invalidInput = true;
} catch (Exception e)
{
System.out.println("There was an error with System.in");
System.out.println(e.getMessage());
invalidInput = true;
}
} while (invalidInput);
SortChain tester = new SortChain(listOneSize, maxStringLengthListOne, listTwoSize, maxStringLengthListTwo);
tester.sortLinkedDataAndDisplayResults();
tester.createSortedChainFromTwoAndDisplayResults();
}
} // end RadixSort
In: Computer Science
Financial analysis of new products at Bay City Electronics had always been rather informal. Bill Roberts, who founded the firm in 1970, knew residential electronics because he had worked for almost seven years for another firm specializing in home security systems. But, he had never been trained in financial analysis. In fact, all he knew was what the bank had asked for every time he went to discuss his line of credit.
Bay City had about 45 full?time employees (plus a seasonal factory work force) and did in the neighborhood of $18 million in sales. His products all related to home security and were sold by his sales manager, who worked with a group of manufacturers' reps, who in turn called on wholesalers, hardware and department store chains, and other large retailer. He did some consumer advertising, but not much.
Bill was inventive, however, and had built the business primarily by coming up with new techniques. His latest device was a remote-controlled electronic closure for any door in the home. The closure was effected by a special ringing of the telephone: for example, if a user wanted to leave a back door open until 9:00 p.m. it was simple to call the house at 9:00 and wait for 10 rings, after which the electronic device would switch the door to a locked position. A similar call would reopen the door.
The bank liked the idea but wanted Bill to do a better job of financial analysis. Based on his understanding of this market, Bill filled out the FINANCIAL worksheet as appears at the end of the exercise. To date, Bay City had spent $85,000 in expense money for supplies and labor developing the closure and had invested $15,000 in a machine (asset). If the company decided to go ahead, it would have to invest $50,000 more in a new facility, continue R&D to validate and improve the product, and--if things went according to expectations--invest another $45,000 in year 3 to expand production capability.
1) Use the given data to calculate the NPV for the electronic closure product. Do the numbers look good?
2) How is NPV affected if the following contingencies occur? (Assess each of these separately.)
a) Direct manufacturing cost estimate may be overly optimistic, and may never get below the original $16.
b) Competition may force higher marketing costs – what if starting in year 2 the level that must be spent is exactly twice what was forecasted above?
|
Year |
0 |
1 |
2 |
3 |
4 |
5 |
|
Unit sales |
0 |
4000 |
10000 |
18000 |
24000 |
5000 |
|
Revenue per unit |
0 |
52 |
52 |
52 |
52 |
52 |
|
Dollar sales |
0 |
208000 |
520000 |
936000 |
1248000 |
260000 |
|
Production costs: |
||||||
|
Direct |
0 |
64000 |
120000 |
198000 |
216000 |
70000 |
|
Indirect |
0 |
12800 |
24000 |
39600 |
43200 |
14000 |
|
Total |
0 |
76800 |
144000 |
237600 |
259200 |
84000 |
|
Gross profit |
0 |
131200 |
376000 |
698400 |
988800 |
176000 |
|
Direct marketing costs |
0 |
100000 |
80000 |
50000 |
60000 |
10000 |
|
Profit contribution |
0 |
31200 |
296000 |
648400 |
928800 |
166000 |
|
Overheads (excluding R&D): |
||||||
|
Division |
0 |
0 |
0 |
0 |
0 |
0 |
|
Corporate |
0 |
20800 |
52000 |
93600 |
124800 |
26000 |
|
Total |
0 |
20800 |
52000 |
93600 |
124800 |
26000 |
|
Other expenses: |
||||||
|
Depreciation |
16250 |
16250 |
16250 |
31250 |
15000 |
15000 |
|
Cannibalization |
0 |
20800 |
52000 |
93600 |
124800 |
26000 |
|
R&D to be incurred |
15000 |
10000 |
15000 |
10000 |
||
|
Extraordinary expense |
0 |
0 |
5000 |
0 |
0 |
0 |
|
Project abandonment |
3000 |
0 |
0 |
0 |
0 |
0 |
|
Total |
19250 |
52050 |
83250 |
139850 |
149800 |
41000 |
|
Overheads and expenses |
19250 |
72850 |
135250 |
233450 |
274600 |
67000 |
|
Income before taxes |
-19250 |
-41650 |
160750 |
414950 |
654200 |
99000 |
|
Tax effect: |
||||||
|
Taxes on income |
-6545 |
-14161 |
54655 |
141083 |
222428 |
33660 |
|
Tax credits |
-65 |
-142 |
547 |
1411 |
2224 |
337 |
|
Total effect |
-6480 |
-14019 |
54108 |
139672 |
220204 |
33323 |
|
Cash flow: |
||||||
|
Income after taxes |
-12770 |
-27631 |
106642 |
275278 |
433996 |
65677 |
|
Depreciation |
16250 |
16250 |
16250 |
31250 |
15000 |
15000 |
|
Production facilities |
50000 |
45000 |
||||
|
Working capital: Cash |
0 |
20800 |
31200 |
41600 |
31200 |
-124800 |
|
Working capital: Inventories |
0 |
20800 |
31200 |
41600 |
31200 |
-99840 |
|
Working capital: Acc. Rec. |
0 |
31200 |
46800 |
62400 |
46800 |
-187200 |
|
Net cash flows |
-46520 |
-84181 |
13692 |
115928 |
339796 |
492517 |
|
Discounted flows |
-46520 |
-67888 |
8904 |
60803 |
143725 |
168001 |
Assumptions:
|
Tax Rate: |
34% |
|
Tax Credits (as % of tax rate): |
1% |
|
Cost of Capital: |
24% |
|
Working Capital: |
|
|
Cash as % of Sales |
10% |
|
Invent. as % of Sales |
10% |
|
Accounts Receivable as % of Sales |
15% |
|
WC Recovery in Year 5 |
|
|
% of Cash |
100% |
|
% of Inventory |
80% |
|
% of Accounts Rec. |
100% |
In: Finance
Question
Calculate Pay Back Period, Net Present Value, Internal Rate of Return and Profitability Index (Benefit Cost Ration) of each of these projects and decide and provide your analysis which project is better. Critically evaluate your decision.
On January 11, 2005, the finance committee of Harding Plastic Molding Company (HPMC) met to consider eight capital budgeting projects. Present at the meeting were Robert L. Harding, President and founder, Susan Jorgensen, comptroller, and Chris Woelk, head of research & development. Over the past five years this committee has met every month to consider and make final judgment on all proposed capital outlays brought up for review during the period.
Harding Plastic Molding Company was founded in 1954 by Robert L. Harding to produce plastic parts and molding for the Detroit automakers. For the first 10 years of operations, HPMC worked solely as a subcontractor for the automakers, but since then has made strong efforts to diversify in an attempt to avoid the cyclical problems faced by the auto industry. By 1970 this diversification attempt had led HPMC into the production of over 1000 different items, including kitchen utensils, camera housings, phonographic and recording equipment. It also led to an increase in sales of 500 percent during 1964 to 1974 prod. As this dramatic increase in sales was paralleled by a corresponding increase in production volume, HPMC was forced, in late 1973, to expand production facilities. This plant and equipment expansion involved capital expenditure of approximately $ 10.5 million and resulted in an increase of production capacity of about 40 percent. Because of this increased production capacity, HPMC has made a concerted effort to attract new business, and consequently, has recently entered into contracts with a large toy firm and a major discount department store chain. While non-automotive related business has grown significantly, it still only represents 32 percent of HPMC’s overall business. Thus, HPMC has continued to solicit non-automotive business, and as a result of this effort and its internal research and development, the firm has four sets of mutually exclusive projects to consider at this month’s finance committee meeting.
Over the past 10 years, HPMC’s capital budgeting approach has evolved into a somewhat elaborate procedure in which new proposals are categorized into three areas – profit, research and development, and safety. Projects falling into the profit or research and development area are evaluated by using present value techniques. Assuming a 10% opportunity cost, those falling into the safety classification are evaluated in a more subjective framework. Although research and development projects have to receive favorable results from the present value criteria, there is also a total dollar limit assigned to projects of this category, typically running about $ 750,000 per year. This limitation was imposed by Harding primarily because of the limited availability of quality researchers in the plastics industry. Harding felt that if more funds than this were allocated, “We simply couldn’t find the manpower to administer them properly”. The benefits derived from safety projects, on the other hand, are not in terms of cash flows; hence, present value methods are not used at all in the evaluation. The subjective approach used to evaluate safety projects is a result of the pragmatically difficult task of quantifying the benefits from these projects into dollar terms. Thus, these projects are subjectively evaluated by a management worker committee with a limited budget. All eight projects to be evaluated in January are classified as profit projects.
The first set of projects listed on the meeting’s agenda for examination involves utilization of HPMC’s precision equipment. Project A calls for production of vacuum containers for thermos bottles produced for a large discount hardware chain. The containers would be manufactured in five different size and colour combinations. This project would be carried out over a three-year period. Project B involves manufacture of inexpensive photographic equipment for a national photography outlet. Although HPMC currently has excess plant capacity, both of these projects would utilize precision equipment of which the excess capacity is limited. Thus adopting either project would tie up all precision facilities. In addition, the purchase of new equipment would be both prohibitively expensive and involve a time delay of about two years, thus making these projects mutually exclusive. (The cash flows associated with these two projects are given in exhibit-1)
|
Year |
Project-C |
Project-D |
|
0 |
-8,000 |
-20,000 |
|
1 |
11,000 |
25,000 |
|
Year |
Project-A |
Project-B |
|
0 |
-75,000 |
-75,000 |
|
1 |
10,000 |
43,000 |
|
2 |
30,000 |
43,000 |
|
3 |
100,000 |
43,000 |
|
Year |
Projects-E |
Project-F |
|
0 |
-30,000 |
-271,500 |
|
1 |
210,000 |
100,000 |
|
2 |
100,000 |
|
|
3 |
100,000 |
|
|
4 |
100,000 |
|
|
5 |
100,000 |
|
|
6 |
100,000 |
|
|
7 |
100,000 |
|
|
8 |
100,000 |
|
|
9 |
100,000 |
|
|
10 |
100,000 |
|
Year |
Project-G |
Project-H |
|
0 |
-500,000 |
-500,000 |
|
1 |
225,000 |
150,000 |
|
2 |
225,000 |
150,000 |
|
3 |
225,000 |
150,000 |
|
4 |
225,000 |
150,000 |
|
5 |
225,000 |
150,000 |
|
6 |
150,000 |
|
|
7 |
150,000 |
|
|
8 |
150,000 |
|
|
9 |
150,000 |
|
|
10 |
150,000 |
In: Finance
CASE STUDY: Excavation Buckets Design and Manufacture
Peter Border is a qualified mechanical engineer who graduated from
the QTech University two years ago. Peter works for Trueblood, a
small mechanical design and manufacturing company. Owner and
founder of the company is William Trueblood.
William qualified as a mechanical tradesman and saw the opportunity
to build a business based on designing and manufacturing complex
parts for large earthmoving equipment. The business was founded 35
years ago and today employs 55 people. Trueblood Enterprises
currently has three professional engineers, Rohan Petronis (25
years of experience), Claude Weatherly (15 years of experience),
and Peter. Claude is in charge of the manufacturing area while
Rohan and Peter comprise the design and analysis division.
Two months ago, Trueblood Enterprises were contracted by Cranbrook
Excavators to design and manufacture an excavation buckets for a
range of large excavators and draglines that the company
manufactures. Cranbrook Excavators is a large company with total
worldwide sales of about $2 billion (Australian). Trueblood
Enterprises was elated to gain the contract as they had been trying
for several years to secure a contract with Cranbrook Excavators.
It is hoped that this initial contract will lead to further large
contracts between the two companies.
Design of the excavation buckets was undertaken by Rohan and Peter.
The designed part was extremely difficult to analyse and eventually
they adopted a design which they considered was adequate and safe,
but with which they were not entirely happy. The design was done
manually without modern 3D modelling and simulation tools. They
would have liked to have had more time to carry out further
analysis work, but the production area needed to get the parts into
production in order to meet the timelines associated with the
contract. The first batch of parts (10) has now been manufactured
and delivered and Cranbrook Enterprises has expressed their
pleasure at the way in which the contract has been fulfilled to
date. The contract calls for the manufacture of a further 100 parts
over the next 18 months.
The contract price for the parts is $22 000 each, and Trueblood
Enterprises currently estimates that the total cost of design and
manufacture will be $18 500 each.
Although busy with other work since the finalisation of the design
for the excavation buckets, Peter has continued to ponder how the
analysis of the part could be improved. Last night he had a sudden
flash of inspiration and two hours’ calculation this morning has
provided a much improved understanding of the stress distribution
which is likely to occur in the bucket design. On reviewing the new
analysis, Peter becomes concerned that the existing design may
create the possibility of fatigue failure in the longer term.
Further analysis leads him to the conclusion that the premature
failure of the existing units is a distinct possibility, although
failure is unlikely to occur until 15,000 hours, though this needs
to be further validated. The original contract specification asked
for a minimum fatigue life of 20,000 hours. Peter also does a quick
estimate of the likely cost of using an improved design in
manufacturing and estimates that the cost per part will rise to $20
500.
Peter discusses his findings with Rohan. Initially Rohan is
reluctant to take any action whatsoever, as he considers it would
reflect poorly on the design and analysis division, and
particularly on his inherent leadership of that area based on his
extended years of experience. When Peter presses the issue and
threatens to go directly to William Trueblood, Rohan agrees to set
up a meeting between William, Peter and himself.
At the meeting, Peter presents his findings and recommends that the
new design be adopted for production, and that the parts already
manufactured and supplied be recalled from Cranbrook Excavators.
Predictably, William Trueblood gets very upset and irate. He asks
if the parts that have already been supplied are in danger of
imminent failure and Rohan says no. William Trueblood states that
his decision is that the current parts will not be recalled and the
production process will continue to manufacture the existing design
and not the new design. He says that the existing part is "safe
enough" and the company cannot afford to increase the cost of
production. He also says that he is extremely disappointed with the
performance of Rohan and Peter, and that the design and analysis
division needs to "get its act together or the company will have to
consider closing this division and outsourcing its design work". He
also says that if Rohan or Peter so much as blink an eyelid out of
place in the future they will be sacked from the company!
- Identify and discuss the management, contractual and ethical
issues involved in this case. What courses of action would be
appropriate for Peter to follow (starting immediately)?
- The answer should be no more than 3000 words. This is merely a guide and there is no penalty associated with this word count. The final section of the main body of the report should clearly identify the courses of action that Peter should follow. This section will be a major section of the report on which technical content will be judged. The conclusions reached and action recommended, however, will need to be supported by the arguments presented in the previous sections of the report. This final section should be between 200 and 250 words in length.
- Your report should have a formal format with title page, executive summary, contents page and references. The report should be word processed
In: Operations Management