Questions
I need to update this program to follow the these requirements please and thank you :...

I need to update this program to follow the these requirements please and thank you :

Do not use packages

Every class but the main routine class must have a toString method . The toString method for Quadrilateral should display its fields: 4 Points.

All instance variables should be declared explicitly private .

Area incorrect : enter points no: 1 1 3 enter points no: 2 6 3 enter points no: 3 0 0 enter points no: 4 5 0 This is a Parallelogram Area is : 15.811

Type of quadrilateral incorrect : enter points no: 1 5 4 enter points no: 2 5 0 enter points no: 3 0 4 enter points no: 4 0 0 This is a Parallelogram Area is : 20.000

The assignment question is :

Write an inheritance hierarchy for the classes Quadrilateral (an abstract class), Trapezoid, Parallelogram, Rectangle, and Square and then code it up. Create and use a Point class that has instance variables: x-coordinate and y-coordinate (each quadrilateral will have 4 of these, declared in the Quadrilateral class as protected). Each class must be defined in a separate .java file.Write one or more constructors, get and set methods for each class, and another method that computes the area of the object of each class (except for Point and Quadrilateral). For simplicity require that one side of any CMPSC Assignments4quadrilateral lie along the x-axis, and any figure with parallel sides will have a parallel side lying along the x-axis; do NOT assume that the points have to entered in any particular order; reject any input that fails to meet these conditions. Test all of these methods.In a separate class write a main function that prompts the user for the 4 points. Hence there will be 7 classes: Point, Quadrilateral (abstract), Trapezoid, Parallelogram, Rectangle, Square, and a Driver (with the main routine).Extra credit: enhance the above to remove the simplifying requirement (NOT trivial!).

The program :

////// MAIN CLASS ////

package main;


import java.util.Scanner;

public class Main {

static double distSq(Point p, Point q)
{
return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
  
//Check whether for points forms rectangle or not.
static boolean isRectangle(Point p1, Point p2, Point p3, Point p4) {
  
double d1 = distSq(p1, p2); // from p1 to p2
double d2 = distSq(p2, p3); // from p2 to p3
double d3 = distSq(p3, p4); // from p3 to p4
double d4 = distSq(p4, p1); // from p4 to p1
  
//Diagonal dist
double d5 = distSq(p1,p3);
  
//d5==d1+d2 ,then it divides the points into two right angle triangle .Hence it is a rectangle
if(d5==d1+d2) {
return true;
}else {
return false;
}

}
// This function returns true if (p1, p2, p3, p4) form a
// square, otherwise false
static boolean isSquare(Point p1, Point p2, Point p3, Point p4)
{
double d2 = distSq(p1, p2); // from p1 to p2
double d3 = distSq(p1, p3); // from p1 to p3
double d4 = distSq(p1, p4); // from p1 to p4
  
// If lengths if (p1, p2) and (p1, p3) are same, then
// following conditions must met to form a square.
// 1) Square of length of (p1, p4) is same as twice
// the square of (p1, p2)
// 2) Square of length of (p2, p3) is same
// as twice the square of (p2, p4)
  
if (d2 == d3 && 2 * d2 == d4
&& 2 * distSq(p2, p4) == distSq(p2, p3)) {
return true;
}
  
// The below two cases are similar to above case
if (d3 == d4 && 2 * d3 == d2
&& 2 * distSq(p3, p2) == distSq(p3, p4)) {
return true;
}
if (d2 == d4 && 2 * d2 == d3
&& 2 * distSq(p2, p3) == distSq(p2, p4)) {
return true;
}
  
return false;
}
  
static boolean isParallelogram(Point p1, Point p2, Point p3, Point p4){
//To determine this first we calculate slope
double a = slope(p1,p2);
double b = slope(p3,p4);
double c = slope(p1,p4);
double d = slope(p2,p3);
  
double g = slope(p1,p3);
double h = slope(p2,p4);
  
  
  
//Test for parallelogram
if(a==b && (c==d || g==h)) {
return true;
}
return false;
}
  
static boolean isTrapezoid(Point p1, Point p2, Point p3, Point p4){
//To determine this first we calculate slope
double a = slope(p1,p2);
double b = slope(p3,p4);
double c = slope(p1,p4);
double d = slope(p2,p3);
  
//Test for parallelogram
if(a==b || c==d) {
return true;
}
return false;
}
  
static private double slope(Point p1, Point p2) {
// TODO Auto-generated method stub
return (p2.y-p1.y)/(p2.x-p1.x);
}

public static void main(String[] args) {
// TODO Auto-generated method stub
Point[] arr = new Point[4] ;
Scanner sc = new Scanner(System.in);
for(int i=0;i<4;i++) {
System.out.printf("%s%n","enter points no: "+(i+1));
double first = sc.nextDouble();
double second = sc.nextDouble();
arr[i] = new Point(first,second);
}
  
if(isSquare(arr[0],arr[1],arr[2],arr[3])) {
  
System.out.printf("%s%n","This is a Square");
Square s = new Square(arr[0],arr[1],arr[2],arr[3]);
System.out.printf("Area is : %5.3f%n",s.area());
  
}
else if(isRectangle(arr[0],arr[1],arr[2],arr[3])) {
  
System.out.printf("%s%n","This is a Rectangle");
Rectangle r = new Rectangle(arr[0],arr[1],arr[2],arr[3]);
System.out.printf("Area is : %5.3f%n",r.area());
  
  
}
else if(isParallelogram(arr[0],arr[1],arr[2],arr[3])) {
  
System.out.printf("%s%n","This is a Parallelogram");
Parallelogram p = new Parallelogram(arr[0],arr[1],arr[2],arr[3]);
System.out.printf("Area is : %5.3f%n",p.area());

}else if(isTrapezoid(arr[0],arr[1],arr[2],arr[3])) {
System.out.printf("%s%n","This is a Trapezoid");
Trapezoid t = new Trapezoid(arr[0],arr[1],arr[2],arr[3]);
System.out.printf("Area is : %5.3f%n",t.area());
  
  
}else {
System.out.printf("%s%n","Invalid Inputs");
}
  
  
}

}

//////////////////class Parallelogram//////////////

package main;


class Parallelogram extends Quadrilateral{
Point p1;
Point p2;
Point p3;
Point p4;

public Parallelogram(Point point, Point point2, Point point3, Point point4) {
// TODO Auto-generated constructor stub
this.p1=point;
this.p2=point2;
this.p3=point3;
this.p4=point4;
}
  
double distSq(Point p, Point q)
{
return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}

@Override
double area() {
// TODO Auto-generated method stub
double side = Math.sqrt(distSq(p1,p2));
double side2 = Math.sqrt(distSq(p1,p3));
return side*side2;
}

}

//////////////////class Point//////////////

package main;


public class Point {
// x represents x axis value and y represents y axis value
double x;
double y;
//Constructor to initialize data members
Point(double x, double y){ this.x=x; this.y=y; } }

//////////////////class Quadrilateral//////////////

package main;


abstract class Quadrilateral { abstract double area(); }

//////////////////class Rectangle//////////////

package main;


class Rectangle extends Quadrilateral{

Point p1;
Point p2;
Point p3;
Point p4;
  
public Rectangle(Point point, Point point2, Point point3, Point point4) {
// TODO Auto-generated constructor stub
this.p1=point;
this.p2=point2;
this.p3=point3;
this.p4=point4;
}

double distSq(Point p, Point q)
{
return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
  
@Override
double area() {
// TODO Auto-generated method stub
double side = Math.sqrt(distSq(p1,p2));
double side2 = Math.sqrt(distSq(p1,p3));
return side*side2;
}

}

//////////////////class Square//////////////

package main;


public class Square extends Quadrilateral{

//Data members
Point p1;
Point p2;
Point p3;
Point p4;

//Constructor

Square(Point p1, Point p2, Point p3, Point p4){
this.p1=p1;
this.p2=p2;
this.p3=p3;
this.p4=p4;

}
  
double distSq(Point p, Point q)
{
return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
  
  
@Override
double area() {
// TODO Auto-generated method stub
double d1 = Math.sqrt(distSq(p1, p2)); // from p1 to p2
double d2 = Math.sqrt(distSq(p3, p4)); // from p1 to p3
  
return d1*d2;

}

}

////////////////////////////////Trapezoid///////////////

package main;

class Trapezoid extends Quadrilateral{


Point p1;
Point p2;
Point p3;
Point p4;
  
public Trapezoid(Point point, Point point2, Point point3, Point point4) {
// TODO Auto-generated constructor stub
this.p1=point;
this.p2=point2;
this.p3=point3;
this.p4=point4;
}

double distSq(Point p, Point q)
{
return (p.x - q.x) * (p.x - q.x) + (p.y - q.y) * (p.y - q.y);
}
  
@Override
double area() {
// TODO Auto-generated method stub

return 0.5*Math.abs((p1.x*(p2.y-p3.y)+p2.x*(p3.y-p1.y)+p3.x*(p1.y-p2.y))) + 0.5*Math.abs((p1.x*(p3.y-p4.y)+p3.x*(p4.y-p1.y)+p4.x*(p1.y-p3.y)));
}

}

In: Computer Science

QUESTION 1 BUSINESS CASE: THIS IS BUSINESS In recent years, because of the Public Procurement Act,...

QUESTION 1 BUSINESS CASE: THIS IS BUSINESS In recent years, because of the Public Procurement Act, District Assemblies have been given the authority to award contracts on certain projects, which do not cost more than 150 million cedis. In view of this, at the District where I work, the Assembly was to construct three markets, at 150 million cedis per project. However, the law is that before such contracts are awarded, they should be made known to the general public by advertising in any of the local newspapers. Therefore, these three market projects were subsequently put on tender through publication in one of the Ghanaian daily newspapers. One week after the advertisement, I received an Expedited Mail Service (EMS) letter, inviting me to Accra to meet a man I did not know for an important message at a particular date. Initially I did not want to honour the invitation. However, upon reflection I decided to go and meet the man because I was expecting some important information from a brother who was in the United States. On arriving in Accra, specifically at the man’s office in the Kantamanto commercial area, I was told the man was attending a meeting at a nearby office building and had directed that I should wait for him. I met the man’s secretary at the office. He served me a bottle of malta guinness. About twenty minutes later, the man arrived from the meeting and I was introduced to him. Beaming with smiles, he in turn introduced himself by mentioning his name as Mr. Opoku Afriyie. As it was already lunchtime, he suggested that we go to a restaurant for lunch. We found ourselves in a popular restaurant. I was asked to order whatever I wished to eat. But, as I did not know why I was being entertained, I was not at ease. The man kept saying, “Oh feel free, you are at home”. There was no doubt that he wanted to impress me. We, finally, drove back to his office. It was then he introduced himself to me as a building contractor and explained why he had invited me to Accra. He told me that he had read the advertisement from my Assembly inviting contractors to bid for the construction of the three markets. He was interested, he continued. He went on to say that, at a meeting somewhere, a friend told him to contact me because I was the schedule officer for those projects, he would be grateful and he was prepared to offer something. He ended by saying: “My brother, this is business that we are talking of. Here is ¢10,000.00 and 2 packets of roofing sheets. I want you to tell me the bill of quantities and estimated quotations from your consultants, and also quotations from other bidders”. In fact, I was flabbergasted and surprised to hear that. For five minutes, I was quiet and the man was doing all the talking. First, I needed six hundred cedis to pay my younger sister’s school fees. Second, I needed about one packet of aluminum roofing sheets to renovate my parents’ building. However, because it was difficult to say no to him and at the same time, I did not want to accept the offer, I politely suggested to the man to submit his completed contract document, telling him that his chances of winning were high, as at the time nobody had come for any of the contract forms. He was persistent and was prepared to offer an additional ¢500.00. But I refused to take anything from him. I then asked to leave; he asked his driver to take me to the State Transport Yard to take a bus back. He gave me ¢500.00 to pay for my transport fare, which I took.

vii. What do you understand by the term ethical dilemma?

viii. Besides this case, mention three other ethical issues that public officials encounter in their daily work life

ix. Mention four (4) importance of values to you as an individual or the District Assembly you work with.

x. Discuss the Blanchard and Pearl’s model of resolving ethical dilemmas

In: Finance

Maintenance records of a certain type of machine indicate that the first-year maintenance cost of $80 increases by $30 per year over the 10-year replacement period of the machine.

Maintenance records of a certain type of machine indicate that the first-year maintenance cost of $80 increases by $30 per year over the 10-year replacement period of the machine. Answer the following if the maintenance cost is considered to occur at the end of the year and the firm’s interest rate is 12%:

 a) What equal annual payments could the firm make to a service organization to carry out the maintenance for 20 machines?

 b) How much additional could be paid for a new type of machine with the same service life that required no maintenance during its life?

In: Finance

Sunday Inc. just paid dividends of $2 per share. Assume that dividends will grow as follows, 5% next year, 8% in year two, and 10% in year 3.


Sunday Inc. just paid dividends of $2 per share. Assume that dividends will grow as follows, 5% next year, 8% in year two, and 10% in year 3. After that growth is expected to level off to a constant growth rate of 11% per year thereafter. The required rate of return is 15%. 

a. Calculate the present value of the stock. (Po) 

b. What is the value of the stock in Year 2 (P3) ? 

In: Finance

A firm in the year 1990 bought 60 baseball bats for $20 each and sold 40 of them in the same year for $ 25 each. What was the firm’s profit or loss for the year?

A firm in the year 1990 bought 60 baseball bats for $20 each and sold 40 of them in the same year for $ 25 each. What was the firm’s profit or loss for the year?

Q5:

  1. The cost of a baseball bat to a trading company is $ 28. What should its selling price be if it wishes to earn 25% as a percentage of cost.
  2. The cost of a baseball bat to a trading company is $ 28. What should its selling price be if it wishes to earn 25% as a percentage of sales.

 

In: Operations Management

Your firm has a free cash flow of $300 at year 1, $360 at year 2, and $864 at year 3. After three years, the firm will cease to exist.

Your firm has a free cash flow of $300 at year 1, $360 at year 2, and $864 at year 3. After three years, the firm will cease to exist. As of today (i.e. at year 0), the firm is partially financed with a 1-year maturity debt, whose face value is $660 and interest rate is 10%. After the debt matures at year 1, the firm will not issue any more debt and will remain unlevered. Assume that the firm’s unlevered cost of capital is 20%, and the firm’s cost of debt is identical to the interest rate on the debt (i.e. 10%). The corporate tax rate is 40%.

What is the firm’s enterprise value if the firm were unleveled?

  A.

$1,012

  B.

$1,000

  C.

$1,024

  D.

$1,524  

 

  1. What is the discount rate for the interest tax shield?

      A.

    Cost of levered equity

      B.

    WACC

      C.

    Cost of debt

      D.

    Cost of unlevered equity

 

  1. What is the present value of the interest tax shield?

      A.

    $12

      B.

    $33

      C.

    $24

      D.

    $66

 

  1. What is the firm’s enterprise value?

      A.

    $1,000

      B.

    $1,524

      C.

    $1,024

      D.

    $1,012

In: Finance

Which is a better investment 3% per year compounded monthly or 3.2% per year simple interest? ​

Which is a better investment 3% per year compounded monthly or 3.2% per year simple interest? 

Given that (1+0.0025)12 =1.0304.​

In: Math

A bank invested $50 million in a one-year asset paying 10 percent interest per year and...

A bank invested $50 million in a one-year asset paying 10 percent interest per year and simultaneously issued a $50 million, two-year liability paying 8 percent interest per year to pay for it. • Is the bank short funded or long funded? • What is the bank’s net interest income in year one • What will be the bank’s net interest income in year two if at the end of the first year all interest rates have decreased by 1.5 percent (150 basis points)?

In: Finance

A 3-year $100 par value bond pays 9% annual coupons. The spotrate of year 1...

  1. A 3-year $100 par value bond pays 9% annual coupons. The spot rate of year 1 is 6%, the 2- year spot rate is 12%, and the 3-year spot rate is 13%.
    a) Determine the price of the bond
    b) Determine the yield to maturity of the bond

  2. A 2-year $100 par value bond pays 5% semi-annual coupons. The 6-month spot rate is 2%, the 1-year spot rate is 2.5%, the 18-month spot rate is 3% and the 2-year spot rate is 4%.
    c) Determine the price of the bond
    d) Determine the yield to maturity of the bond

In: Finance

Dufner Co. Issued 15-year bonds one year ago at a coupon rate of 4.8 percent.

Dufner Co. Issued 15-year bonds one year ago at a coupon rate of 4.8 percent. The bonds make semiannual payments. If the YTM on these bonds is 5.3 percent, what is the current dollar price assuming a $1,000 par value? (Do not round intermediate calculations and round your answer to 2 decimal places, e.g., 32.16.) 

Current bond price = _______ 


In: Finance