Questions
Q2: A small manufacturer employs 5 skilled men and 10 semi-skilled men and makes an article...

Q2: A small manufacturer employs 5 skilled men and 10 semi-skilled men and makes an article in 2 qualities, a deluxe model and an ordinary model. The making of a deluxe model requires 2 hours work by a skilled man and 2 hours work by a semi-skilled man. The ordinary model requires 1 hour work by a skilled man and 3 hours work by a semi-skilled man. By union rules no man can work more than 8 hours per day. The manufacturer’s clear profit of the deluxe model is $ 10 and of the ordinary model is $8. Formulate the model of the problem.

Solution:

In: Operations Management

IN JAVA!!! This is called the Josephus problem. Josephus.mp4Play media comment. Use words.txt as input. Use...

IN JAVA!!!

This is called the Josephus problem. Josephus.mp4Play media comment.

Use words.txt as input.

Use the Node class and the Circular Queue class you created in L5b.

In your main program input the words from words.txt into a Queue (a circular queue) - do this by using enqueue .

Then input an integer (n). Then starting at the head of the queue delete every nth node until only one node remains. Output the String in that last node.

Make NO changes to the Node class. In the Queue class you will need a method to delete every nth node.

You will need to print your queue, so make a print method in your Queue class. This should print the ENTIRE queue, not just the head. It is true that at the end only the head should remain, but by printing the entire queue and finding there is only one node printed you are verifying to me (and to yourself) that only the head remains.

When I ran my program these are the answers I got:

n=5 : hostelry

n=29: cliquish

n=7: alienist

SUGGESTION: Try this on a smaller input file first. This one contains just the numbers 1-20    Ex.txt

You can try this by hand, and then verify that your program is correct. For n=5, the answer is "20"

NODE CLASS

class Node<T> {
//Node makes item, next, and prev all private
//and therefore has to provide accessors
//and mutators (gets and sets)
private T item;
private Node next;
private Node prev;

Node(T newItem) {
item = newItem;
next = null;
prev = null;
}

Node(T newItem, Node nextNode, Node prevNode) {
item = newItem;
next = nextNode;
prev = prevNode;
}

/**
* @return the item
*/
public T getItem() {
return item;
}

/**
* @param item the item to set
*/
public void setItem(T item) {
this.item = item;
}

/**
* @return the next
*/
public Node getNext() {
return next;
}

/**
* @param next the next to set
*/
public void setNext(Node next) {
this.next = next;
}

/**
* @return the prev
*/
public Node getPrev() {
return prev;
}

/**
* @param prev the prev to set
*/
public void setPrev(Node prev) {
this.prev = prev;
}

}

QUEUE CLASS

class Queue<T> {

private Node head, tail = null;
int size = 0;
public Queue() {
head = tail = null;
size = 0;
}
//enqueue
public void enqueue(T item) {
Node temp = new Node(item);
if (head == null) {
head = temp;
tail = temp;
} else {
temp.next = head;
tail.next = temp;
tail = temp;
}
size++;
}

//dequeue
public T dequeue(T item) {
Node temp = head;
head = head.next;
tail.next = head;
size--;
return (T) temp.item;
}
//size
public int size() {
if (size == 0) {
}
return size;
}
//peek
public T peek() {
return (T) head.item;
//return item
}
//isEmpty
public boolean isEmpty() {
return (size == 0);
}
//print in queue class
public void print() {
if(head != null) {
Node curr = head;
System.out.println(curr.item);
curr = curr.next;
while (curr != head) {
System.out.println(curr.item);
curr = curr.next;
}
}
}

//Deletes every nth node until only one node remains
public void delete(int num, Queue q) {
Node head = q.head;
Node tail = q.tail;
int count;
Node temp = tail;
int length = q.size;
while((head != tail) && length > 1){
count = 1;
while(count != num){
temp = temp.next;
count++;
}
System.out.println("Deleting " + temp.next.item);
temp.next = temp.next.next;
length--;
}
q.head = temp;
q.tail = temp;
q.size = length;
}
}

In: Computer Science

How do I respond to this. -->When determining the market price of a bond that is...

How do I respond to this. -->When determining the market price of a bond that is trade-able there are a few things to consider.The amounts, currency and timing of the interest payments and capital repayment due, the quality of the bond, and available redemption yield of other comparable bonds which can be traded in the markets.

In: Finance

How would Hyper-V be installed on a Windows Server Core installation?

How would Hyper-V be installed on a Windows Server Core installation?

In: Computer Science

You are considering a 3-year project of which details are summarized below. Your required rate of...

You are considering a 3-year project of which details are summarized below. Your required rate of return for capital budgeting purposes is 20 percent.

  • Annual sales = 30,000 units
  • Unit sales price = $5.00
  • Variable costs = $2.00 per unit
  • Annual fixed costs = $18,000
  • Initial capital investment = $72,000, depreciated to zero over 3 years
  • Initial investment in working capital = $20,000, fully recovered at the end of the project
  • The tax rate is 25%

a. What is the project’s annual net income?

b. What is the project’s annual operating cash flow?

c. What is the project’s initial capital investment?

d. What is the project’s NPV?  

e. What is the project’s IRR?  

f. Should you accept this project? Why or why not?

In: Finance

3M is an innovative business. What makes the 3M company innovative as a business and personally?...

3M is an innovative business. What makes the 3M company innovative as a business and personally? Is 3M a company that largely pursues sustained innovation, or would you consider them a disruptor?

In: Economics

1). How does systems theory work in dealing with misunderstandings? 2). Describe a Learning Organization, what...

1). How does systems theory work in dealing with misunderstandings?

2). Describe a Learning Organization, what are its functions?

(Please answer each of these in 4-5 sentences each).

In: Psychology

Explain how businesses can use price elasticity of demand to make decisions about whether to raise...

  1. Explain how businesses can use price elasticity of demand to make decisions about whether to raise or lower prices.

In: Economics

1) Within the main function, the call to the constructor by defense of a class called...

1) Within the main function, the call to the constructor by defense of a class called MyClass is made by creating the firstClass object as follows.

A) MyClass firstClass;

B) MyClass firstClass (8);

C) MyClass () firstClass;

D) MyClass firstClass ();

In: Computer Science

YEAR 0 YEAR 1 YEAR 2 YEAR 3 MACRS DEPRECIATION RATE 33.33% 44.45% 14.81% 7.41% A...

YEAR 0 YEAR 1 YEAR 2 YEAR 3
MACRS
DEPRECIATION RATE 33.33% 44.45% 14.81% 7.41%

A fast-food company invests $2.2 million to buy machines for making Slurpees. These can be depreciated using the MACRS schedule shown above. If the cost of capital is 10%, what is the increase in the net present value (NPV) of the product gained by using MACRS depreciation over straight-line depreciation for three years? A) $28,559 B) $47,599 C) $76,158 D) $190,321

Please help me, I'm not able to use excel in my class so if I could get a step by step that would help me immensely

In: Finance

Which of the following is not a source of switching costs? Question 3 options: Financial Commitment....

Which of the following is not a source of switching costs?

Question 3 options:

Financial Commitment.

Learning Costs.

Loyalty Programs.

Lack of Contractual Commitments.

2,

Agile Development""

Question 2 options:

Tends to take too much time to implement, and is typically considered inflexible.

A relatively linear, and sequential approach to software development.

Seeks to enable more frequent product roll outs, and constant improvement across smaller components of a large project.

Frequently considered the "classic" method of software development.

3,

Which of the following is not an attribute of "Infrastructure as a Service" ("IaaS")?

Question 5 options:

It offers an organization an alternative to buying its own physical hardware.

It offers an organization the opportunity to pay solely for the resources that it consumes.

It typically requires the least amount of support and maintenance.

It offers an organization the least opportunity for customization.

In: Computer Science

Nitrosyl bromide (NOBr) can be obtained as a pure liquid at low temperatures. The liquid boils...

Nitrosyl bromide (NOBr) can be obtained as a pure liquid at low temperatures. The liquid boils at –2°C, and at room temperature the gas partially decomposes, as shown below. 2 NOBr(g) Á 2 NO(g) + Br2(g) A 2.00-g sample of cold liquid NOBr is injected into a 1.0 L flask. (Assume that the flask was first evacuated so that it does not contain any air or other gases.) When the flask is allowed to come to equilibrium at 298 K, the total pressure inside is measured as 0.624 atm. (5 pts) (a). Calculate the total number of moles of gas present in the flask at equilibrium. (This part should be easy!) (b). Now find the numerical value of Keq for the reaction above at 298 K. (HINT: Set up the usual equilibrium table, and then try to relate the final concentrations to the total number of moles you found in part

In: Chemistry

1. Remove left recursions if any A -> Aab | abA | ab B -> bb...

1. Remove left recursions if any

A -> Aab | abA | ab
B -> bb | Bb | bB

In: Computer Science

Prove the following problems. 1 .Use the definition of big O to explain why or why...

Prove the following problems.

1 .Use the definition of big O to explain why or why not 3/(x2 + 3x) = O(3). Prove your answer.

2 .Use the definition of  Θ to explain why or why not sqrt(2 + sqrt(3x)) =  Θ(x1/4). Prove your answer.

3 .Explain why 5x2 =  Θ(2x2) is true and  5x2 ~ 2x2 is not true.

In: Computer Science

Explain one of the Rater Errors and the consequences of that error. What training and/or systems...

Explain one of the Rater Errors and the consequences of that error. What training and/or systems would you put in place for the leadership of an organization in order to reduce the impact of that Rater Error on performance management? The Rater Errors are stereotype error, attribution error, spillover error, halo error, and primary error.

The subject is Evaluation, Coaching, and Mentoring

In: Operations Management