Questions
Comeputer science .This is java problem. PROBLEM 1 Queue (Links to an external site.) is an...

Comeputer science .This is java problem.

PROBLEM 1

Queue (Links to an external site.) is an abstract data type (ADT) consisting of a sequence of entities with a first-in-first-out (FIFO) (Links to an external site.) property. Queue has the following operations, in alignment with the Java Queue interface (Links to an external site.) in the Oracle's SDK:

  • add(x): inserts the specified x element to the back of queue without violating capacity limitation.
  • remove(): removes the head (front) of queue, returning the removed element.
  • peek(): retrieves and displays but does not remove (i.e., read-only) the head of queue.
  • isEmpty: returns whether the queue is empty or not as boolean.

Implement the above FOUR (4) operations in your Solution class as follows. You are responsible for implementing the area shown in red below. Note that you are given TWO (2) local Stacks to help you manage the above listed queue operations.

STARTER CODE

import java.util.Stack;
public class HomeworkAssignment5_1 {    
    public static void main(String[] args) {
       // just like any problems, whatever you need here, etc.
    }
}
class Solution {

   // YOUR STACK TO USE FOR THIS PROBLEM
   private Stack<Integer> pushStack = new Stack<Integer>();
   private Stack<Integer> popStack = new Stack<Integer>();

   /* =====================================
   /* !!! DO NOT MODIFY ABOVE THIS LINE!!!
   /* ====================================

   // YOUR STYLING DOCUMENTATION HERE
   public void add(int x) { 
      // YOUR CODE HERE
   }
   // YOUR STYLING DOCUMENTATION HERE
   public int remove() { 
      // YOUR CODE HERE
   }
   // YOUR STYLING DOCUMENTATION HERE
   public int peek() { 
      // YOUR CODE HERE
   }
   // YOUR STYLING DOCUMENTATION HERE
   public boolean isEmpty() { 
     // YOUR CODE HERE
   }
}

EXAMPLES

// TEST CASE #1
Solution sol = new Solution();
sol.add(8);
sol.add(1);  
sol.peek();     // 8 (if you use System.out.println(), for example)
sol.remove();   // 8
sol.isEmpty();  // false
sol.remove();   // 1
sol.isEmpty();  // true
sol.add(2);     
sol.add(3); 
sol.peek();     // 2

// TEST CASE #2
// etc.

CONSTRAINTS / ASSUMPTIONS

  • You must use Java Stack (Links to an external site.) (java.utils.Stack), both local pushStack and popStack instances, to implement the solution queue for this problem; failure to do so receives 0 logic points.
  • You must use only the standard Stack methods, pop(), push(), peek(), and empty(), for this problem.
  • This problem tests your understanding of how queue works in Java by implementing it from scratch using the Stack ADT you learned.
  • All operations called on the queue are valid. In other words, both remove() and peek() will NOT be called on an empty queue. This means you won't have to create any Exceptions to handle errors.
  • Your solution will be tested against 9-10 test cases; -1 for each failed test.

In: Computer Science

be the chief Software Engineer, and your mission is to describe functional and non-functional requirements, as...

be the chief Software Engineer, and your mission is to describe functional and non-functional requirements, as good and detailed as possible. When you are missing data, you have to make assumptions (sometimes wild ones). No one can really answer your questions, and you have a presentation to the higher management in 45 min sharp. By then, you have to construct a document, with a very small ( no more than 10 lines) executive description, and no more than two A4 pages (1.25 space, font 12) text. Good luck.

INFORMATION ABOUT THE PROJECT

Our company is seriously considering of bidding for the following project, and we ask you, the lead Software Engineer, to construct a draft document, with the functional and non-functional requirements. The better your document, the better job will do our business development team to construct a proposal.

Project abstract description

The project is about monitoring the two gates of the University, automate the entry of authorized personnel, plus record all car license plates, if they left at night, and also raise alarms if a car is in the parking for more than 5 days. Also the system needs to report cars that are still at the parking, or during any holiday, or when the University is closed officially (e.g., during summer holidays). During those periods, only high-ranking personnel is automatically allowed to enter (e.g., Deans). All others need to be stopped at the gate, and call their supervisor. For that purpose, the following descriptions have been gathered.

Notes

• Each security room next to each gate, will be equipped with the necessary hardware, in order for the guards to see the license plate camera, plus another camera facing the car driver. Also each car will be equipped with electronic id device. The entry bar will be connected to the system, and will be automatically raised, if the car and driver are both authorized.

  • The license plate cameras have to have a good false positive rate. The driver-side camera will not do face recognition at the beginning, but the client wants this to be an option for the near future.

  • The time it takes for one car to enter, is of great importance. The client needs to know this in detail.

  • There should be a “manual override” button on the screen, but the system should keep all details possible, guard details, time, date, car & license picture, etc.

  • The client will accommodate all data into their own facilities and infrastructure, but they will not provide any hardware/software for this project.

  • The guards will be trained accordingly if desired.

  • The data gathered should not be used for other purposes.

  • The staff, students, faculty, are really worried about their personal data, and how those

    are going to be used. Some even claim that the data will be used to monitor their

    working time.

  • Our company, is worried about the cost of this project, and we want to find innovative

    ways to keep the cost low, so we can bid a lower price, and get a competitive advantage

    against other bidders.

  • Our company also is not very experienced in such projects, and they hired you to “make

the difference”.

In: Computer Science

ArrayStack: package stacks; public class ArrayStack<E> implements Stack<E> {    public static final int CAPACITY =...

ArrayStack:

package stacks;
public class ArrayStack<E> implements Stack<E>
{
   public static final int CAPACITY = 1000; // Default stack capacity.
   private E[] data; //Generic array for stack storage.
   private int top = -1; //Index to top of stack./*** Constructors ***/
   public ArrayStack()
   {
       this(CAPACITY);
       }
   //Default constructor
   public ArrayStack(int capacity)
   {
       // Constructor that takes intparameter.
       data = (E[]) new Object[capacity];
       }
   /*** Required methods from interface ***/
   public int size()
   {
       return (top + 1);
       }
   public boolean isEmpty()
   {
       return (top == -1);
       }
   public void push(E e) throws IllegalStateException
   {
       if(size() == data.length)
       {
           throw new IllegalStateException("Stack is full!");
           }
       data[++top] = e;
       }
   public E top()
   {
       if(isEmpty())
       {
           return null;
           }
       return data[top];
       }
   public E pop()
   {
       if(isEmpty())
       {
           return null;
           }
       E answer = data[top];
       data[top] = null;
       top--;
return answer; }
}

Recall: In the array based implementation of the stack data type, the stack has a limited capacity due to the fact that the length of the underlying array cannot be changed. In this implementation, when a push operation is called on a full stack then an error is returned and the operation fails. There are certain applications where this is not useful. For example, a stack is often used to implement the \undo" feature of text editors, or the \back" button in a web browser. In these cases, it makes sense to remove the oldest element in the stack to make room for new elements. A similar data structure, called a leaky stack is designed to handle the above type of situation in a dierent manner. A leaky stack is implemented with an array as its underlying storage. When a push operation is performed on a full leaky stack, however, the oldest element in the stack is \leaked" or removed out the bottom to make room for the new element being pushed. In every other case, a leaky stack behaves the same as a normal stack. Write an implementation of the leaky stack data structure. Your class should be generic and implement the following public methods: push, pop, size, and isEmpty. Your class must also contain at least two constructors: one where the user does not specify a capacity and a default capacity of 1000 is used, and one where the user does specify a capacity.

Hint: The following is a skeleton of the class to get started (You will have to fill in the missing implementations of the abstract methods from the Stack interface):

public class LeakyStack implements Stack {

public static final int DEFAULT = 1000;

private E[] stack; private int size = 0;

private int stackTop = -1;

public LeakyStack()

{

this(DEFAULT);

}

public LeakyStack(int c);

public void push(E e);

public E pop();

public boolean isEmpty();

public int size(); }

In: Computer Science

Solve in Excel. Show formulas A) You are considering an investment that will pay you $12,000...

Solve in Excel. Show formulas

A) You are considering an investment that will pay you $12,000 the first year, $13,000 the second year, $17,000 the third year, $19,000 the fourth year, $23,000 the fifth year, and $28,000 the sixth year (all payments are at the end of each year).

What is the maximum you would pay for this investment if your opportunity cost is 12%?

B) You are considering an investment that will pay you $12,000 the first year, $13,000 the second year, $17,000 the third year, $19,000 the fourth year, $23,000 the fifth year, and $28,000 the sixth year.

If you pay $70,000 for such an investment, rate of return would you be earning?

C) How much would you be willing to pay for an investment that will pay you and your heirs $16,000 each year in perpetuity if your opportunity cost is 6%?

In: Finance

7. [The following information applies to the questions displayed below.] Hans runs a sole proprietorship. Hans...

7.

[The following information applies to the questions displayed below.]

Hans runs a sole proprietorship. Hans reported the following net §1231 gains and losses since he began business: (Leave no answer blank. Enter zero if applicable.)

Net §1231

Year

Gains/(Losses)

Year 1

$(73,500)

Year 2

19,250

Year 3

0

Year 4

0

Year 5

13,400

Year 6

0

Year 7 (current year)

54,250

a. What amount, if any, of the year 7 (current year) $54,250 net §1231 gain is treated as ordinary income?

Ordinary income

?

b. Assume that the $54,250 net §1231 gain occurs in year 6 instead of year 7. What amount of the gain would be treated as ordinary income in year 6?

Ordinary income

?

In: Accounting

Conch Republic can manufacture the new smart phones for $300 each in variable costs. Fixed costs...

Conch Republic can manufacture the new smart phones for $300 each in variable costs. Fixed costs for the operation are estimated to run $4.3 million per year. The estimated sales volume is 75,000, 95,000, 125,000, 130,000, and 140,000 per year for the next five years, respectively. The unit price of the new smart phone will be $650. The necessary equipment can be purchased for $61 million and will be depreciated on a seven-year MACRS schedule. It is believed the value of the equipment in five years will be $3.4 million.
Shelley has asked you to prepare a report that answers the following questions.

Please use template below to show answer in excel.

Input:

Year 1 Year 2 Year 3 Year 4 Year 5
Units Sales                 75,000          95,000           125,000        130,000    140,000
Equipment Cost        61,000,000
Salvage value           3,400,000
Units Price                       650
Variable cost (per unit)                       300
Fixed costs (per year)           4,300,000
Tax rate 35%
NWC (% of sales) 15%
Required return 12%
Required Payback Period (years)                             3
MACRS Schedule Year 1 Year 2 Year 3 Year 4 Year 5 Year 6 Year 7 Year 8
3-year 33.33% 44.45% 14.81% 7.41%
5- year 20.00% 32.00% 19.20% 11.52% 11.52% 5.76%
7-year 14.29% 24.49% 17.49% 12.49% 8.93% 8.92% 8.93%

4.46%

Pro Forma Income Statements
Year Year 1 Year 2 Year 3 Year 4 Year 5
Revenues          48,750,000          61,750,000         81,250,000        84,500,000        91,000,000
Variable costs          22,500,000          28,500,000         37,500,000        39,000,000        42,000,000
Fixed costs             4,300,000             4,300,000            4,300,000           4,300,000           4,300,000
Depreciation             8,716,900          14,938,900         10,668,900           7,618,900           5,447,300
EBIT          13,233,100          14,011,100         28,781,100        33,581,100        39,252,700
Taxes (35%)             4,631,585             4,903,885         10,073,385        11,753,385        13,738,445
Net income             8,601,515             9,107,215         18,707,715        21,827,715        25,514,255
OCF       17,318,415       24,046,115      29,376,615     29,446,615     30,961,555
Net Working Capital
Year Year 0 Year 1 Year 2 Year 3 Year 4 Year 5
Initial NWC                              -  
Ending NWC
NWC cash flow
Salvage Value
Market value of salvage
Book value of salvage
Taxes on sale:
Aftertax salvage value:
Project Cash Flows
Year Year 0 Year 1 Year 2 Year 3 Year 4 Year 5
OCF
Change in NWC
Capital spending
Total cash flow
Cumulative cash flow
Question 1 Value Decision
Payback Period
Question 2
NPV
Question 3
IRR
Question 4
Profitability Index
Question 5
Target Sales Price

In: Finance

O'Brien Company namufactures and sells one product.The following information pertains to each of the company's first...

O'Brien Company namufactures and sells one product.The following information pertains to each of the company's first three years of operations.

Variable cost per unit:                                          

Manufacturing:                                                      

Direct materials                                                  $26

Direct labor                                                         $17

Variable manufacturing overhead                       $4

Variable selling & administrative                        $2

Fixed costs per year:

Fixed manufacturing overhead                        $540,000

Fixed sellingn & administrative expense          $160,000

During its first year of operations, O'Brien produced 96,000 units and sold 78,000 units. During its second year of operations, it produced 82,000 units and sold 95,000 units. In its third year, O'Brien produced 86,000 units and sold 81,000 units. The selling price of the companys products is $77 per unit.

1. Required:

1. Assume the company uses variable costiong and FIFO inventory flow assumption (FIFO means first-in first-out. In other words, if assumes that the oldest units in inverntory are sold first):

a. Compute the unit product cost for Year 1, Year 2 and Year 3

Year 1..............................Unit Product Cost............................

Year 2..............................Unit Product Cost...........................

Year 3..............................Unit Product Cost...........................

b. Prepare a income statement for Year 1, Year 2 and Year 3

                                                                                                       O'Brien Company

                                                                                              Variable Costing Income Statement

                                                                                                            Year 1                Year 2           Year 3

Variable expenses                                                                                                                                                          

Total variable expenses

Fixed expenses:

Total fixed expenses

2. Assume the company uses variable costing and LIFO inventory flow assumption (LIFO means last-in first-out. In other words, it assumes that the newest units in inventory are sold first):

a. Compute the unit porduct cost for Year 1, Year 2, and Year 3

Year 1..............................Unit Product Cost.......................

Year 2..............................Unit Product Cost.......................

Year 3..............................Unit Product Cost.......................

b. Prepare an income statement for Year 1, Year 2, and Year 3

                                                                                                           O'Brien Company

                                                                                              Variable Costing Income Statement

                                                                                                 Year 1                Year 2              Year 3

                                                                                                                                                                                                               

Variable expenses

Total variable expenses

Fixed expenses:

Total fixed expenses

3. Assume the company uses absorption costing and a FIFO inventory flow assumption (FIFO means first-in first-out. In other words, it assumes that the oldest units in inventory are sold first):

a. Compute the unit product cost for Year 1, Year 2, Year 3. (Round your intermediate calculations and final answers to 2 decimal places)

Year 1......................................Unit Product Cost................................

Year 2......................................Unit Product Cost................................

Year 3......................................Unit Product Cost..............................

b. Prepare an income statement for Year 1, Year 2 and Year 3. (Round your intermediate calculations to 2 decimal places.)

                                                            O'Brien Company

                                                       Absorption Costing Income Statement

                                                                                                   Year 1                                    Year 2                                    Year 3

4. Assume the company uses absorption costing and a LIFO inventory flow assumptions (LIFO means last-in first-out. In other words, it assumes that the newest units in inventory are sold first).

a. Compute the unit product cost for Year 1, Year 2,and Year 3. (Round your intermediate calculations and final answers to 2 decimal places.)

Year1....................................Unit Product Cost........................

Year 2..................................Unit Product Cost...........................

Year 3..................................Unit Product Cost..........................

b. Prepare an income statement for Year 1, Year 2, and Year 3. (Round your intermidiate calculations to 2 decimal places.)

                                                                       O'Brien Company

                                                              Absorption Costing Income Statement

                                                                                    Year 1          Year 2        Year 3                

In: Accounting

The managers of Classic Autos Incorporated plan to manufacture classic Thunderbirds​ (1957 replicas). The necessary foundry...

The managers of Classic Autos Incorporated plan to manufacture classic Thunderbirds​ (1957 replicas). The necessary foundry equipment will cost a total of ​$3,900,000 and will be depreciated using a​ five-year MACRS​ life, The sales manager has an estimate for the sale of the classic Thunderbirds. The annual sales volume will be as​ follows:

year one: 230, year two: 290, year three: 340, year four: 350, year five: 310

If the sales price is $29,000 per​ car, variable costs are $17,000 per​ car, and fixed costs are $1,400,000 ​annually, what is the annual operating cash flow if the tax rate is 30​%? The equipment is sold for salvage for $500,000 at the end of year five. Net working capital increases by $600,000 at the beginning of the project​ (year 0) and is reduced back to its original level in the final year. Find the internal rate of return for the project using the incremental cash flows.

  Year

​3-Year

​5-Year

​7-Year

​10-Year

    1

​33.33%

​20.00%

​14.29%

​10.00%

    2

​44.45%

​32.00%

​24.49%

​18.00%

    3

​14.81%

​19.20%

​17.49%

​14.40%

    4

​ 7.41%

​11.52%

​12.49%

​11.52%

    5

​11.52%

​8.93%

​9.22%

    6

​ 5.76%

​8.93%

​7.37%

    7

​8.93%

​6.55%

    8

​4.45%

​6.55%

    9

​6.55%

  10

​6.55%

  11

​3.28%

a) First, what is the annual operating cash flow of the project for year one? year 2? year 3? year 4? year 5?

b) Next, what is the after tax cash flow of the equipment at disposal?

c) Then what is the incremental cash flow of the project in year 0? year 1? year 2? year 3? year 4? year 5?

d) What is the IRR of the project?

In: Finance

Required information [The following information applies to the questions displayed below.] O’Brien Company manufactures and sells...

Required information

[The following information applies to the questions displayed below.]

O’Brien Company manufactures and sells one product. The following information pertains to each of the company’s first three years of operations:

Variable costs per unit:
Manufacturing:
Direct materials $ 28
Direct labor $ 16
Variable manufacturing overhead $ 6
Variable selling and administrative $ 2
Fixed costs per year:
Fixed manufacturing overhead $ 510,000
Fixed selling and administrative expenses $ 200,000

During its first year of operations, O’Brien produced 91,000 units and sold 77,000 units. During its second year of operations, it produced 77,000 units and sold 86,000 units. In its third year, O’Brien produced 86,000 units and sold 81,000 units. The selling price of the company’s product is $79 per unit.

2. Assume the company uses variable costing and a LIFO inventory flow assumption (LIFO means last-in first-out. In other words, it assumes that the newest units in inventory are sold first):

a. Compute the unit product cost for Year 1, Year 2, and Year 3.

b. Prepare an income statement for Year 1, Year 2, and Year 3.

Complete this question by entering your answers in the tabs below.

Compute the unit product cost for Year 1, Year 2, and Year 3.

Unit Product Cost
Year 1
Year 2
Year 3

Complete this question by entering your answers in the tabs below.

  • Req 2A
  • Req 2B

Prepare an income statement for Year 1, Year 2, and Year 3.

O’Brien Company
Variable Costing Income Statement
Year 1 Year 2 Year 3
Variable expenses:
Total variable expenses 0 0 0
0 0 0
Fixed expenses:
Total fixed expenses 0 0 0
$0 $0 $0

3. Assume the company uses absorption costing and a FIFO inventory flow assumption (FIFO means first-in first-out. In other words, it assumes that the oldest units in inventory are sold first):

a. Compute the unit product cost for Year 1, Year 2, and Year 3.

b. Prepare an income statement for Year 1, Year 2, and Year 3.

Complete this question by entering your answers in the tabs below.

  • Req 3A
  • Req 3B

Compute the unit product cost for Year 1, Year 2, and Year 3. (Round your intermediate calculations and final answers to 2 decimal places.)

Unit Product Cost
Year 1
Year 2
Year 3
  • Req 3A
  • Req 3B
  • Complete this question by entering your answers in the tabs below.

  • Req 3A
  • Req 3B
  • Prepare an income statement for Year 1, Year 2, and Year 3. (Round your intermediate calculations to 2 decimal places.)

    O’Brien Company
    Absorption Costing Income Statement
    Year 1 Year 2 Year 3
    0 0 0
    $0 $ 0 $0

    4. Assume the company uses absorption costing and a LIFO inventory flow assumption (LIFO means last-in first-out. In other words, it assumes that the newest units in inventory are sold first):

    a. Compute the unit product cost for Year 1, Year 2, and Year 3.

    b. Prepare an income statement for Year 1, Year 2, and Year 3.

  • Complete this question by entering your answers in the tabs below.

  • Req 4A
  • Req 4B
  • Unit Product Cost
    Year 1
    Year 2
    Year 3
  • Req 4A
  • Req 4B
  • Compute the unit product cost for Year 1, Year 2, and Year 3. (Round your intermediate calculations and final answers to 2 decimal places.)

    Complete this question by entering your answers in the tabs below.

  • Req 4A
  • Req 4B
  • Prepare an income statement for Year 1, Year 2, and Year 3. (Round your intermediate calculations to 2 decimal places.)

    O’Brien Company
    Absorption Costing Income Statement
       Year 1 Year 2 Year 3
      
  • Req 4A
  • Req 4B

In: Accounting

Purple Corporation, an exterminating company, is a calendar year taxpayer. It contracts to provide service to...

Purple Corporation, an exterminating company, is a calendar year taxpayer. It contracts to provide service to homeowners once a month under a one-, two-, or three-year contract. On April 1 of the current year, the company sold a customer a one-year contract for $120. How much of the $120 is taxable in the current year if the company is an accrual basis taxpayer. If the $120 is payment on a two-year contract, how much is taxed in the year the contract is sold and in the following year? If the $120 is payment on a three-year contract, how much is taxed in the year the contract is sold and in the following year?

In: Accounting