Questions
Osama Co. is a listed company operating in the textile industry. Osama Co’s board of directors...

Osama Co. is a listed company operating in the textile industry. Osama Co’s board of directors met recently to discuss a new strategy for the business. The proposal put forward was to sell all the old plant and machinery and use this fund as well as borrow from market to purchase new plant and equipment. The new plant and machinery are more productive and meet the current standard quality required by the international buyers. It is also argued that new plant is more energy efficient and environment friendly that gives more advantage when facing international competitors.

The proposal stated that the funds raised from the sale of the old plant and machinery would be used to buy the new plant and machinery.

New borrowing for the balance amount will be made from local bank which offered lowest rate. Since inflation is on higher side compared to last few years so cost of borrowing is on higher side which will increase firm cost of capital.

The board of directors are of the opinion that increasing the level of debt in OSAMA Co. will increase the company’s risk and therefore it can increase its cost of equity capital. It is assumed that due to change in plant and equipment current local sales of the product will not be affected.

New Plant price                                  Rs.5.32 million

Sales of old plant                                Rs.1.32 million

Firm existing capital structure i.e. debt to assets ratio is 40:60.

At this level firm interest rate on all debt is 9.5%.

After borrowing firm capital structure will shift to 60:40 and at this level firm beta will shift from earlier 1.2 to 1.4. Risk free rate of return is 7% and market risk premium is 6%. New loan is negotiated with HBL bank and it is agreed that this loan will be for five years at 11% mark up.

  1. How much borrowing required by firm?
  2. Why risk factor will increase if firm is changing its capital structure?
  3. What is the current weighted average cost of capital?
  4. What the new cost of equity capital?
  5. What would be new Weighted Average Cost of Capital?

In: Accounting

Question 7                                         &nbs

Question 7                                                                                                                  6 Marks

  1. Given the following code, use lambdas and streams to calculate and display the number of marks greater than or equal to 50 (i.e. the total number that have passed).                                                                                                        (1 mark)

public static void main(String[] args) {

    int[] marks = {10, 53, 65, 49, 46, 95, 81, 45, 72, 85};

         //use lambdas and streams to work out how many

         // marks are >= 50 and display the result.

         <part (a) to complete>

      }

      Output should be similar to the following:

    The number of marks greater than or equal to 50 = 6

  1. The following is the class diagram for the Result class used in this question.

Given the starting point for the code below, use lambdas and streams to complete the main method as follows:

  1. Write a Predicate called supplementary that returns true if the mark is in the supplementary range (>=45 and <50) and false if the mark is not in this range.                                                                                              (1 mark)
  2. Make use of the predicate from part (i) to display all the result records (student id and mark) with marks in the supplementary range     
  3. Use lambdas and streams to calculate and display the average mark.

    

In the answer template complete the code for parts (i) to (iii) where you see <to be completed> in the code below:

public class StreamQuestion {

    public static void main(String[] args) {

        Result[] results = {new Result("S123345", 10),

                            new Result("S678901", 53),

                            new Result("S778901", 65),

                            new Result("S878901", 49),

                            new Result("S078901", 81),

                            new Result("S688901", 45),

                            new Result("S698901", 72),

                            new Result("S679901", 46),

                            new Result("S678911", 72),

                            new Result("S678912", 85)};

       

        List<Result> resultList = Arrays.asList(results);       

                                  

       //(i) Write the code for the supplementary predicate

        <Part (i) To be completed>

   // (ii) using the predicate (and lambdas and streams),  

   // display the student id and mark for all results in

   // the supplementary range

       <Part (ii) To be completed>

   // (iii) using lambdas and streams calculate and display

   // the average mark           

       <Part (iii) To be completed>

    }  

The output generated should be similar to the following:

Supplementary List:

<S878901 49>

<S688901 45>

<S679901 46>

Average Mark: 57.80

In: Computer Science

import java.awt.*; import javax.swing.JButton; import javax.swing.JFrame; public class GridBagLayoutDemo { final static boolean shouldFill = true;...

import java.awt.*;
import javax.swing.JButton;
import javax.swing.JFrame;

public class GridBagLayoutDemo {
final static boolean shouldFill = true;
final static boolean shouldWeightX = true;
final static boolean RIGHT_TO_LEFT = false;

public static void addComponentsToPane(Container pane) {
if (RIGHT_TO_LEFT) {
pane.setComponentOrientation(ComponentOrientation.RIGHT_TO_LEFT);
}

JButton button;
pane.setLayout(new GridBagLayout());
GridBagConstraints c = new GridBagConstraints();
if (shouldFill) {
//natural height, maximum width
c.fill = GridBagConstraints.HORIZONTAL;
}

button = new JButton("Button 1");
if (shouldWeightX) {
c.weightx = 0.5;
}
c.fill = GridBagConstraints.HORIZONTAL;
c.gridx = 0;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Button 2");
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.5;
c.gridx = 1;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Button 3");
c.fill = GridBagConstraints.HORIZONTAL;
c.weightx = 0.5;
c.gridx = 2;
c.gridy = 0;
pane.add(button, c);

button = new JButton("Long-Named Button 4");
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 40; //make this component tall
c.weightx = 0.0;
c.gridwidth = 3;
c.gridx = 0;
c.gridy = 1;
pane.add(button, c);

button = new JButton("5");
c.fill = GridBagConstraints.HORIZONTAL;
c.ipady = 0; //reset to default
c.weighty = 1.0; //request any extra vertical space
c.anchor = GridBagConstraints.PAGE_END; //bottom of space
c.insets = new Insets(10,0,0,0); //top padding
c.gridx = 1; //aligned with button 2
c.gridwidth = 2; //2 columns wide
c.gridy = 2; //third row
pane.add(button, c);
}

private static void createAndShowGUI() {
//Create and set up the window.
JFrame frame = new JFrame("GridBagLayoutDemo");
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//Set up the content pane.
addComponentsToPane(frame.getContentPane());

//Display the window.
frame.pack();
frame.setVisible(true);
}

public static void main(String[] args) {
//Schedule a job for the event-dispatching thread:
//creating and showing this application's GUI.
javax.swing.SwingUtilities.invokeLater(new Runnable() {
public void run() {
createAndShowGUI();
}
});
}
}

I need someone to go through this program and right more comments that explain a lot more Please. from top to bottom Thanks

In: Computer Science

In the provided client and server code, the server can serve to single client at a...

In the provided client and server code, the server can serve to single client at a time. You have to change server.java code so that it can connect and serve multiple clients at the same time. Use multithreading.
===============================================================================
import java.io.*;

import java.net.*;

public class Client {

    public static void main(String[] args) throws IOException {

        String serverHostname = new String ("127.0.0.1");

        if (args.length > 0) {

//pass the hsotname through cmd argument

            serverHostname = args[0];

        }

        System.out.println ("Attemping to connect to host " + serverHostname + " on port 10007.");

        Socket echoSocket = null;

        PrintWriter out = null;

        BufferedReader in = null;

        try {

//Connect to server and open IO stream

            echoSocket = new Socket(serverHostname, 10007);

            out = new PrintWriter(echoSocket.getOutputStream(), true);

            in = new BufferedReader(new InputStreamReader(

                    echoSocket.getInputStream()));

        } catch (UnknownHostException e) {

            System.err.println("Don't know about host: " + serverHostname);

            System.exit(1);

        } catch (IOException e) {

            System.err.println("Couldn't get I/O for " + "the connection to: " +

                    serverHostname);

            System.exit(1);

        }

        BufferedReader stdIn = new BufferedReader( new InputStreamReader(System.in));

        String userInput;

        System.out.print ("input-comand: ");

        while ((userInput = stdIn.readLine()) != null) {

//send to server using socket

            out.println(userInput);

//read reply from server

            String replyFromServer = in.readLine();

            System.out.println("Answer: " + replyFromServer);

            if(replyFromServer.trim().toLowerCase().equals("bye")){

                break;

            }

            System.out.print ("input-command: ");

        }

        out.close();

        in.close();

        stdIn.close();

        echoSocket.close();

    }

}

//=================================================

import java.net.*;

import java.io.*;
import java.util.Scanner;

public class Server {

    public static void main(String[] args) throws IOException {

        ServerSocket serverSocket = null;

        try {

            serverSocket = new ServerSocket(10007);

        }

        catch (IOException e) {

            System.err.println("Could not listen on port: 10007.");

            System.exit(1);

        }

        Socket clientSocket = null;

        System.out.println ("Waiting for connection ...");

        try {

            clientSocket = serverSocket.accept();

        }

        catch (IOException e) {

            System.err.println("Accept failed.");

            System.exit(1);

        }

        System.out.println ("Connection successful");

        System.out.println ("Waiting for input ...");

//open IO streams

        PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true);

        BufferedReader in = new BufferedReader(new

                InputStreamReader( clientSocket.getInputStream()));

        String inputLine;

//wait and read input from client. Exit when input from socket is Bye
        Scanner scanFile = new Scanner(new File("DNS-table.txt"));
        boolean found =false;
        while ((inputLine = in.readLine()) != null)

        {

            System.out.println ("Server: " + inputLine);
            String line ="";

            if (inputLine.trim().toLowerCase().equals("bye"))
            {
                out.println(inputLine);
                break;
            }


            while (scanFile.hasNextLine())
            {
                //reply back to client
                line  = scanFile.nextLine();
                String[] tokens = line.split(" ");
                if(inputLine.equalsIgnoreCase(tokens[0]) || inputLine.equalsIgnoreCase(tokens[1])) {
                    found = true;
                    break;
                }

                else
                    found = false;

            }
            if(found) {
                out.println(line);

            }
            else {


                out.println("Not found...");
            }
        }


//close IO streams and at the end socket
        scanFile.close();
        out.close();

        in.close();

        clientSocket.close();

        serverSocket.close();

    }

}

-------------------------------------------------------------

text

www.google.com 192.168.73.1
www.uncc.edu 192.168.73.2
www.abc.com 192.168.73.3
www.espn.com 192.168.73.4
www.cyberDNA.com 192.168.73.55
www.ccaa.uncc.edu 192.168.73.5
www.ccigrad.uncc 192.168.73.13
www.cis.uncc.edu 192.168.73.14
www.unc.edu 192.168.73.12

In: Computer Science

How did the New Deal alter the role of the national government? In your answer, discuss...

How did the New Deal alter the role of the national government? In your answer, discuss three specific New Deal programs or legislation. Describe their impact on American society.

In: Economics

The probability that a customer will buy a new car and an extended warranty is 0.16. If the probability that a customer..

The probability that a customer will buy a new car and an extended warranty is 0.16. If the probability that a customer will purchase a new car is 0.30, find the probability that the customer will also purchase the extended warranty

In: Statistics and Probability

Forecasting the success of the new product introductions is notoriously diffficult. Describe some macroexonomics and microeconomics...

Forecasting the success of the new product introductions is notoriously diffficult. Describe some macroexonomics and microeconomics factors that a firm might consider in forecasting sales for new body soap producy.

In: Economics

During the most recent recession, the Fed used some new and expanded tools. Can you find...

During the most recent recession, the Fed used some new and expanded tools. Can you find any articles on these new tools, such as quantitative easing? Was it considered a success?

In: Economics

I would like to get som survey question for dry cleaning service , I want to...

I would like to get som survey question for dry cleaning service , I want to attract new people who live in the area like new homewoners.

In: Operations Management

You are planning on setting up a new Best Buy in Saudi Arabia. What is your...

You are planning on setting up a new Best Buy in Saudi Arabia. What is your new proposed organizational structure now that Saudi Arabia is your target country?

In: Operations Management