Hooper Printing Inc. has bonds outstanding with 9 years left to maturity. The bonds have an 8% annual coupon rate and were issued 1 year ago at their par value of $1,000. However, due to changes in interest rates, the bond's market price has fallen to $910.40. The capital gains yield last year was - 8.96%.
In: Finance
In: Nursing
3- Use FirstLastList: Write method public void
join(FirstLastList SecondList) such that given two
linked lists, join them together to give one. So if the lists lst1=
[1,3,7,4] and lst2=[2,4,5,8,6], the result of lst1.join(lst2) is
lst1=[1,3,7,4,2,4,5,8,6] and lst2=[].
4- Use FirstLastList: Write method public void
swap(). It swaps the first and last elements of a
FirstLastList. So if lst1= [1,3,7,4], lst1.swap() = [4,3,7,1].
Display or throw an exception if the list contains less than two
elements.
public class FirstLastList
{
private Link first; // ref to first link
private Link last; // ref to last link
//
-------------------------------------------------------------
public FirstLastList() // constructor
{
first = null; // no links on list yet
last = null;
}
//
-------------------------------------------------------------
public boolean isEmpty() // true if no links
{ return first==null; }
//
-------------------------------------------------------------
public void insertFirst(long dd) // insert at front of list
{
Link newLink = new Link(dd); // make new link
if( isEmpty() ) // if empty list,
last = newLink; // newLink <-- last
newLink.next = first; // newLink --> old first
first = newLink; // first --> newLink
}
//
-------------------------------------------------------------
public void insertLast(long dd) // insert at end of list
{
Link newLink = new Link(dd); // make new link
if( isEmpty() ) // if empty list,
first = newLink; // first --> newLink
else
last.next = newLink; // old last --> newLink
last = newLink; // newLink <-- last
}
//
-------------------------------------------------------------
public long deleteFirst() // delete first link
{ // (assumes non-empty list)
long temp = first.dData;
if(first.next == null) // if only one item
last = null; // null <-- last
first = first.next; // first --> old next
return temp;
}
//
-------------------------------------------------------------
public void displayList()
{
System.out.print("List (first-->last): ");
Link current = first; // start at beginning
while(current != null) // until end of list,
{
current.displayLink(); // print data
current = current.next; // move to next link
}
System.out.println("");
}
public void join(FirstLastList otherList) {
Link current = otherList.first; // start at beginning
while (current != null) { // until end of list,
this.insertLast(current.dData);
current = current.next; // move to next link
}
otherList.first = null;
}
public void swap() throws Exception {
int count = 0;
Link current = first; // start at beginning
while (current != null) { // until end of list,
count++;
current = current.next; // move to next link
}
if (count < 2) {
throw new Exception("There is not enough element in the
list.");
} else
{
long firstData = first.dData;
long lastData = last.dData;
first.dData = lastData;
last.dData = firstData;
}
}
}
class Link
{
public long dData; // data item
public Link next; // next link in list
public Link(long d) // constructor
{ dData = d; }
public void displayLink() // display this link
{ System.out.print(dData + " "); }
} // end class Link
public class FirstLastAppTest
{
public static void main(String[] args)
{
FirstLastList lst1 = new FirstLastList(); // Start a new
FirstLastList called lst1
lst1.insertLast(1); // Add links with data to the last
position
lst1.insertLast(3);
lst1.insertLast(7);
lst1.insertLast(4);
System.out.print("\nlst1: "); // print the description for the
list
lst1.displayList(); // print the contents of the list
FirstLastList lst2 = new FirstLastList(); // Start a new FirstLastList called lst2
lst2.insertLast(2); // Add links with data to the last
position
lst2.insertLast(4);
lst2.insertLast(5);
lst2.insertLast(8);
lst2.insertLast(6);
System.out.print("\nlst2: "); // print the description for the
list
lst2.displayList(); // print the contents of the list
System.out.print("\nlst1.join(lst2): "); // print the
action to take place: lst1.join(lst2)
lst1.join(lst2); // call the join method for lst1 to add lst2
System.out.print("\nlst1: "); // print the description for the
list
lst1.displayList(); // print the contents of the list lst1; post
join()
System.out.print("lst2: "); // print the description for the
list
lst2.displayList(); // print the contents of the list lst2; post
join()
System.out.print("\nlst1.swap(): "); // print the action
to take place: lst1.swap()
lst1.swap(); // call the swap method for lst1
System.out.print("\nlst1: "); // print the description for the
list
lst1.displayList(); // print the contents of the list lst1; post
swap()
} // end main()
} // end class
I can't get FirstLastAppTest to work with my code. I can't post my FirstLastApp as I have limited space for 1 question.
PLEASE DO NOT MODIFY FirstLastAppTest!!! Its just for testing the code.
In: Computer Science
student_id=100
set.seed(student_id)
Group1=round(rnorm(15,mean=10,sd=4),2)
Group2= round(rnorm(12,mean=7,sd=4),2)
For this question you are not allowed to use the lm() command in R or the equivalent of lm() in python or other software. If you want to use a software, only use it as a calculator. So if you are using R, you may only use mean(), sum(), qt() and of course +,-,*,/. (Similar restrictions for Python, excel or others).
Consider all the 27 numbers printed under Group1 and Group2 as your y values, and the two group indicators as a categorical variable x ( indicating Group1 vs Group2).
(a) Fit a least square regression line and calculate the intercept and the slope.
(b) At 5% level of significance, test that the true slope parameter is zero.
(c) Match your answer from part (b) to your answers from Question 2. Describe briefly any similarity that you see.
In: Statistics and Probability
The administration at a university is interested in studying if any relationship exists between quality of academic experience at the school and whether the student is a major in the College of Humanities and Social Sciences (HSS major) or has a major in the College of Business (Business major). The school randomly surveys 10 seniors who are HSS students and 10 seniors who are Business students and asks them to rate the quality of their academic experience on a scale of 1-10, where 10 is extremely high and 1 is extremely low. Here are the data:
| HSS Major | Business Major |
| 7 | 4 |
| 6 | 7 |
| 10 | 4 |
| 4 | 6 |
| 8 | 8 |
| 9 | 7 |
| 6 | 9 |
| 8 | 5 |
| 7 | 8 |
| 10 | 7 |
The HSS majors have a mean of 7.5 and a variance of 3.6, whereas the Business majors have a mean of 6.5 and a variance of 2.9.
Answer the following questions:
1. What is the null hypothesis? (1 point)
2. What is the research hypothesis? (1 point)
3. What is the dependent variable? (1 point)
4. Write out the results of an independent samples t-test using these data. In other words, provide the numerical answers: t-statistic, your critical value of t (or p-value), and degrees of freedom. (4 points)
5. Write a paragraph to explain the results of the hypothesis test using statistics from the problem with alpha=0.05. This should be two or more formal sentences to describe your findings and conclusions.
In: Statistics and Probability
Assume that U.S. can produce two goods, compact discs and apples. Compact discs are produced using capital and labor. Apples are produced using land and labor. The total supply of labor is 20 workers. Given the supply of capital, the marginal products of labors are as follows:
|
Number of Workers Employed |
Marginal Product of Labor in Compact Disc Sector |
Marginal Product of Labor in Apples Sector |
|
1 |
16 |
14 |
|
2 |
15 |
13 |
|
3 |
14 |
12 |
|
4 |
13 |
11 |
|
5 |
12 |
10 |
|
6 |
11 |
9 |
|
7 |
10 |
8 |
|
8 |
9 |
7 |
|
9 |
8 |
6 |
|
10 |
7 |
5 |
|
11 |
6 |
4 |
|
12 |
5 |
3 |
|
13 |
4 |
2 |
|
14 |
3 |
1 |
|
15 |
2 |
0 |
Suppose that the price of a compact disc is $2 and the price of apples is $1
The equilibrium allocation of labor between the compact disc sector (LCD) and the apple sector (LA) is respectively
| a. |
LCD = 11 and LA = 9 |
|
| b. |
LCD = 9 and LA = 11 |
|
| c. |
LCD = 10 and LA = 10 |
|
| d. |
LCD = 13 and LA = 7 |
|
| e. |
LCD = 14 and LA = 6 |
B)
Suppose that the price of a compact disc is $2 and the price of apples is $1
The equilibrium wage rate (w) is
| a. |
w = $6 |
|
| b. |
w = $7 |
|
| c. |
w = $8 |
|
| d. |
w = $9 |
|
| e. |
w = $10 |
In: Economics
Your firm is considering issuing one-year debt, and has come up with the following estimates of the value of the interest tax shield and the probability of distress for different levels of debt:
|
Debt Level (in $ million) |
|||||||
|
0 |
40 |
50 |
60 |
70 |
80 |
90 |
|
|
PV (interest tax shield, $ million) |
0.00 |
0.76 |
0.95 |
1.14 |
1.33 |
1.52 |
1.71 |
|
Probability of Financial Distress |
0% |
0% |
1% |
2% |
7% |
16% |
31% |
Suppose the firm has a beta of zero, so that the appropriate discount rate for financial distress costs is the risk-free rate of 5%. Which level of debt above is optimal if, in the event of distress, the firm will have distress costs equal to
a. $2 million?
b. $5 million?
c. $30 million?
In: Finance
java programming
Create a class named Money. It should have member variables
for
Member Variables
Store dollars and cents as members (both should be int). They
should be
accessible from only inside the class.
Methods
Write a default constructor that sets members to 0.
Write a two-parameter constructor that sets members to the
parameter
values.
Write get/set methods for the member variables.
Write an override method for toString. The returned string
should be
formatted as a normal money string. For example, if dollars is 2
and cents is
5 then it should return $2.05. If dollars is 3 and cents is 50 then
it should
return $3.50.
Write an override method for equals. It should return true if
both the
dollars and cents are equal and false otherwise. This means you
compare
the dollars in the current to the dollars in the other and you
compare the
cents in one to the cents in another.
Class – Main
The main method should be in this class.
Declare an array of Money in main. The array should have 20
elements.
Populate the array with data from a file. Use a loop to read data
from the
input file. Use the input file data given at the end of this
document.
Write a loop that will print all elements of the array on screen.
You should
have read all data from the input file before doing this.
Write a loop that will add up all the money in the array and
store the total
in another Money instance. After the loop print the total money on
screen
using the Money instance that has the total. You should use
toString to get
the formatted money string. The total money that gets print should
not
have a cents value over 99. For example, 7 dollars and 160 cents
should be
8 dollars and 60 cents. You should have read all data from the
input file
before doing this.
Add two calls to the Money equals override. One to demonstrate
that the
instances are equal and another to demonstrate that they are not
equal.
In: Computer Science
A statistics student who is curious about the relationship between the amount of time students spend on social networking sites and their performance at school decides to conduct a survey. Three research strategies for collecting data are described below. Match each strategy with the correct sampling method. He randomly samples 40 students from the study's population, gives them the survey, asks them to fill it out and bring it back the next day. Answer 1 He gives out the survey only to his friends, and makes sure each one of them fills out the survey. Answer 2 He posts a link to an online survey on his Facebook wall and asks his friends to fill out the survey. Answer 3
In: Statistics and Probability
A suburban hotel derives its revenue from its hotel and restaurant operations. The owners are interested in the relationship between the number of rooms occupied on a nightly basis and the revenue per day in the restaurant. Below is a sample of 25 days (Monday through Thursday) from last year showing the restaurant income and number of rooms occupied.
| Day | Revenue | Occupied | Day | Revenue | Occupied | ||||||||
| 1 | $ | 1,452 | 40 | 14 | $ | 1,425 | 31 | ||||||
| 2 | 1,361 | 20 | 15 | 1,445 | 51 | ||||||||
| 3 | 1,426 | 21 | 16 | 1,439 | 62 | ||||||||
| 4 | 1,470 | 54 | 17 | 1,348 | 45 | ||||||||
| 5 | 1,456 | 62 | 18 | 1,450 | 41 | ||||||||
| 6 | 1,430 | 29 | 19 | 1,431 | 62 | ||||||||
| 7 | 1,354 | 22 | 20 | 1,446 | 47 | ||||||||
| 8 | 1,442 | 21 | 21 | 1,485 | 43 | ||||||||
| 9 | 1,394 | 15 | 22 | 1,405 | 38 | ||||||||
| 10 | 1,459 | 65 | 23 | 1,461 | 36 | ||||||||
| 11 | 1,399 | 41 | 24 | 1,490 | 61 | ||||||||
| 12 | 1,458 | 35 | 25 | 1,426 | 65 | ||||||||
| 13 | 1,537 | 51 | |||||||||||
|
Determine the coefficient of correlation between the two variables. (Round your answer to 3 decimal places.) c-1. State the decision rule for 0.025 significance level: H0: ρ ≤ 0; H1: ρ > 0. (Round your answer to 3 decimal places.) c-2. Compute the value of the test statistic. (Round your answer to 2 decimal places.) c-3. Is it reasonable to conclude that there is a positive relationship between revenue and occupied rooms? Use the 0.02 significance level. What percent of the variation in revenue in the restaurant is accounted for by the number of rooms occupied? (Round your answer to 1 decimal place.) |
|||||||||||||
In: Statistics and Probability