Java Class
import java.io.File;
import java.io.FileNotFoundException;
import java.util.InputMismatchException;
import java.util.Scanner;
public class ReadInData {
public static double readData(String fileName)
{
File file = new
File(fileName);
Scanner scan;
double sum = 0;
try {
scan = new
Scanner(file);
int numOfValues
= Integer.parseInt(scan.nextLine()); // Read in Val for #
values
for(int i = 0; i
< numOfValues; i++) { // for-loop to get that many values
sum += scan.nextDouble(); // add the values
together (doubles)
}
scan.close();
return sum; //
return the sum of all the values in the file
}//add catch statements
here
}
public static void main(String[] args) {
System.out.println(readData("Test3.txt"));
System.out.println(readData("Test2.txt"));
System.out.println(readData("Text4.txt")); // notice spelling of
the file name!
System.out.println(readData("Test4.txt"));
}
}
Test2.txt
6 5 3.0 "9.8" -19.8 -54.1 85.5
Test3.txt
4.0 5.0 6.2 4.2 1.0
Test4.txt
5 4.2 3.1 2.2 6.1
In: Computer Science
1. National Scan, Inc., sells radio frequency inventory tags. Monthly sales for a seven-month period were as follows:
Month | Sales (000)Units |
Feb. | 19 |
Mar. | 15 |
Apr. | 8 |
May. | 17 |
Jun. | 19 |
Jul. | 20 |
Aug. | 22 |
b.
Forecast September sales volume using each of the
following:
(1) A linear trend
equation.(Round your intermediate calculations and final
answer to 2 decimal places.)
Yt 21.42 Correct thousands
(2) A five-month
moving average. (Round your answer to 2 decimal
places.)
Moving
average Not
attempted thousands
(3) Exponential
smoothing with a smoothing constant equal to .25, assuming a March
forecast of 15(000). (Round your intermediate forecast
values and final answer to 2 decimal places)
Forecast
Not attempted thousands
(4) The naive
approach.
Naive
approach
Not attempted thousands
(5) A weighted average
using .65 for August, .10 for July, and .25 for June.
(Round your answer to 2 decimal places.)
Weighted average Not attempted thousands
In: Operations Management
In: Computer Science
Case – Recreational Park Project
The public has recognized the benefits of recreation and parks as essential to their health and quality of life. A recent survey conducted in 2016 found that the construction of more recreational facilities was a top priority among residents in Lazarette Town (in the Caribbean).
As such, the town council in Lazarette, with the help of other key stakeholders, has sourced and secured three (3) million dollars of grant funds from the Caribbean Wellness Community (CWC) for the development of a mini outdoor recreational park on three (3) acres of land donated by a benevolent resident of the town.
The park will contain sporting facilities among other recreational facilities (e.g. walking trails, children playground, tennis court, basketball court, work out stations, benches, shower facilities, rest rooms etc.). All major key stakeholders and sponsors have unanimously agreed that that the facility should cater for residents of all ages. Additionally, a group of minority stakeholders has expressed their requirements of having an eco-friendly and climate resilient facility. The park should be completed and ready for use by 2022, i.e. the project duration should not exceed two years.
To ensure that the project is completed on time, within scope and on budget, the funding agency and the Lazarette Town Council require that a dedicated and knowledgeable project team is assigned to the project. CWC has expressed the need for the project deliverables to be of ‘high’ quality to guarantee stakeholders’ satisfaction and safety. The CWC requires that ‘tight’ procurement processes should be followed to ensure transparency, accountability and economy. It is anticipated that most of the goods, works and services for building the park will be procured from vendors, suppliers and contractors in the town. In addition, CWC has detailed the need for both positive and negative projects risk to be properly managed throughout the project.
In response to CWC implied and expressed requirements, the Lazarette Town Council has selected and appointed your team to provide project management services for the Recreational Park Project. As a proactive team, your team has decided to use ‘best practices’ in project management to plan project activities and get approval from key project stakeholders before constructing or building the facility. Give the type and nature of the project, the intention is to use a traditional/waterfall approach to project management activities instead of the largely popular and contemporary agile methodology used other industries.
Your team understands the value of planning before doing, and the council’s concerns of not losing the grant funding from CWC. In addition, your team is keen on building a good reputation in the
town. With a can do attitude and the need to increase the chances of the project success, the project management team (your 5-member group) is determined to ensure that the team utilizes the ‘best practices’ for planning, executing and controlling this valuable community based project.
1. Justify the need to effectively manage quality for the project.
In: Operations Management
In: Operations Management
formance lg3 lg4 mary and nick ...
Question: Case Problem 13.1 Assessing the Stalchecks’s Portfolio Performance LG3 LG4 Mary and Nick Stalchec...
Case Problem 13.1
Assessing the Stalchecks’s Portfolio Performance
LG3 LG4 Mary and Nick Stalcheck have an investment portfolio
containing 4 investments. It was developed to provide them with a
balance between current income and capital appreciation. Rather
than acquire mutual fund shares or diversify within a given class
of investments, they developed their portfolio with the idea of
diversifying across various asset classes. The portfolio currently
contains common stock, industrial bonds, mutual fund shares, and
options. They acquired each of these investments during the past 3
years, and they plan to purchase other investments sometime in the
future.
Currently, the Stalchecks are interested in measuring the return on
their investment and assessing how well they have done relative to
the market. They hope that the return earned over the past calendar
year is in excess of what they would have earned by investing in a
portfolio consisting of the S&P 500 Stock Composite Index.
Their research has indicated that the risk-free rate was 7.2% and
that the (before-tax) return on the S&P 500 portfolio was 10.1%
during the past year. With the aid of a friend, they have been able
to estimate the beta of their portfolio, which was 1.20. In their
analysis, they have planned to ignore taxes because they feel their
earnings have been adequately sheltered. Because they did not make
any portfolio transactions during the past year, all of the
Stalchecks’s investments have been held more than 12 months, and
they would have to consider only unrealized capital gains, if any.
To make the necessary calculations, the Stalchecks have gathered
the following information on each investment in their
portfolio.
Common stock. They own 400 shares of KJ Enterprises common stock.
KJ is a diversified manufacturer of metal pipe and is known for its
unbroken stream of dividends. Over the past few years, it has
entered new markets and, as a result, has offered moderate capital
appreciation potential. Its share price has risen from $17.25 at
the start of the last calendar year to $18.75 at the end of the
year. During the year, quarterly cash dividends of $0.20, $0.20,
$0.25, and $0.25 were paid.
Industrial bonds. The Stalchecks own 8 Cal Industries bonds. The
bonds have a $1,000 par value, have a 9.250% coupon, and are due in
2024. They are A-rated by Moody’s. The bonds were quoted at 97.000
at the beginning of the year and ended the calendar year at
96.375%.
Mutual fund. The Stalchecks hold 500 shares in the Holt Fund, a
balanced, no-load mutual fund. The dividend distributions on the
fund during the year consisted of $0.60 in investment income and
$0.50 in capital gains. The fund’s NAV at the beginning of the
calendar year was $19.45, and it ended the year at $20.02.
Options. The Stalchecks own 100 options contracts on the stock of a
company they follow. The value of these contracts totaled $26,000
at the beginning of the calendar year. At year-end the total value
of the options contracts was $29,000.
Questions
a. Calculate the holding period return on a before-tax
basis for each of these 4 investments.
b. Assuming that the Stalchecks’s ordinary income is
currently being taxed at a combined (federal and state) tax rate of
38% and that they would pay a 15% capital gains tax on dividends
and capital gains for holding periods longer than 12 months,
determine the after-tax HPR for each of their 4 investments.
c. Recognizing that all gains on the Stalchecks’s
investments were unrealized, calculate the before-tax portfolio HPR
for their 4-investment portfolio during the past calendar year.
Evaluate this return relative to its current income and capital
gain components.
d. Use the HPR calculated in question c to compute
Jensen’s measure (Jensen’s alpha). Use that measure to analyze the
performance of the Stalchecks’s portfolio on a risk-adjusted,
market-adjusted basis. Comment on your finding. Is it reasonable to
use Jensen’s measure to evaluate a 4-investment portfolio? Why or
why not?
e. On the basis of your analysis in questions a, c, and
d, what, if any, recommendations might you offer the Stalchecks
relative to the revision of their portfolio? Explain your
recommendations
show how to get from a to b.
In: Finance
7. When the price of Coke rises, we see that consumers shift to purchase more Pepsi which is still cheaper. This statement describes:
A) An inferior good.
B) The rationing function of prices.
C) The substitution effect.
D) The income effect.
In: Economics
Find the computational complexity i.e. O(n) etc. for the following four loops and explain why you came to that answer:
In: Computer Science
CHAPTER 21 (12.)
Portions of the financial statements for Parnell Company are
provided below.
PARNELL COMPANY Income Statement For the Year Ended December 31, 2018 ($ in 000s) |
||||||
Revenues and gains: | ||||||
Sales | $ | 780 | ||||
Gain on sale of buildings | 11 | $ | 791 | |||
Expenses and loss: | ||||||
Cost of goods sold | $ | 290 | ||||
Salaries | 118 | |||||
Insurance | 38 | |||||
Depreciation | 121 | |||||
Interest expense | 48 | |||||
Loss on sale of machinery | 12 | 627 | ||||
Income before tax | 164 | |||||
Income tax expense | 82 | |||||
Net income | $ | 82 | ||||
PARNELL COMPANY Selected Accounts from Comparative Balance Sheets December 31, 2018 and 2017 ($ in 000s) |
|||||||||
Year | |||||||||
2018 | 2017 | Change | |||||||
Cash | $ | 132 | $ | 102 | $ | 30 | |||
Accounts receivable | 322 | 218 | 104 | ||||||
Inventory | 323 | 423 | (100 | ) | |||||
Prepaid insurance | 68 | 86 | (18 | ) | |||||
Accounts payable | 208 | 119 | 89 | ||||||
Salaries payable | 106 | 95 | 11 | ||||||
Deferred income tax liability | 64 | 54 | 10 | ||||||
Bond discount | 186 | 202 | (16 | ) | |||||
Required:
1. Prepare the cash flows from operating
activities section of the statement of cash flows for Parnell
Company using the direct method.
2. Prepare the cash flows from operating
activities section of the statement of cash flows for Parnell
Company using the indirect method.
In: Accounting
History Question
How do you think would history have been different if Lincoln had not been assassinated? How might his leadership after the war have differed from that of Andrew Johnson?
In: Psychology
All healers must learn their craft, and all healers must have verifiable outcomes (healed patients) as a result of their treatments. Medical Anthropologists study a wide variety of healers from diverse cultural settings. As you are aware, each culture has very unique definitions of illness and disease, as well as different expectations for being healed. As a result of these factors, we find very different techniques used for healing in these two broad categories of healers, indigenous, and biomedical. Yet even with the profound cultural differences, there are similarities in training and patient relationships between the two groups.
Discuss what are the similarities and/or differences found in training between indigenous healers and biomedical healers? Furthermore, what are the similarities and/or differences in patient healer relationships?
In: Psychology
What do you think would be the toughest part about working with the union issues as a security manager?
In: Psychology
1) Eagle Fabrication has the following aggregate demand requirements and other data for the upcoming four quarters.
Quarter |
Demand |
Previous quarter's output |
1500 units |
1 |
1400 |
Beginning inventory |
200 units |
2 |
1000 |
Stockout cost |
$50 per unit |
3 |
1500 |
Inventory holding cost |
$8 per unit at end of quarter |
4 |
1300 |
Hiring workers |
$5 per unit |
Laying off workers |
$10 per unit |
||
Unit cost |
$30 per unit |
||
Overtime |
$10 extra per unit |
Which of the following production plans is better: Plan A—chase demand by hiring and layoffs; or
Plan B—produce at a constant rate of 1200 and obtain the remainder from overtime?
Finish the calculation and show all work!
Plan A:
Eagle Fabrication Solution
Demand |
Regular Time Capacity |
Regular Time Production |
Hire |
Fire |
|
Initial Inventory |
|||||
Period 1 |
1,400 |
1200 |
|||
Period 2 |
1,000 |
||||
Period 3 |
1,500 |
||||
Period 4 |
1,300 |
||||
Total (units) |
5,200 |
||||
@$30/unit |
@$5/unit |
@$10/unit |
|||
Subtotal Costs |
$?????? |
$???? |
$???? |
||
Total Cost |
$?????? |
Plan B:
Eagle Fabrication Solution
Demand |
Regular Time Capacity |
Overtime Capacity |
Regular Time Production |
Overtime Production |
Inventory (end PD) |
Fire |
|
Initial Inventory |
200. |
||||||
Period 1 |
1,400 |
1,200 |
|||||
Period 2 |
1,000 |
||||||
Period 3 |
1,500 |
||||||
Period 4 |
1,300 |
||||||
Total (units) |
5,200 |
||||||
@$30/unit |
@$30+@$10 = @$40/unit |
@$8/unit |
@$10/unit |
||||
Subtotal Costs |
$?????? |
$???? |
$???? |
$???? |
|||
Total Cost |
$?????? |
Answer:
In: Operations Management
I am writing a scheme function that pairs an element to every element in a list, and I have the following code so far:
(define (pair-element e l)
(cond ((null? l) (list e))
(else (cons e (car l)) (pair-element (cdr l)))))
(pair-element 4 `(4 3 5))
What is my error? I'm getting a pair element mismatch when I run it. I need to do this without using built-in functions. Thanks!
In: Computer Science
For a given CPU, the cycle latency for a set of operations are given as follows:
Addition: 4
Subtraction: 8
Multiplication: 64
Division: 80
If the clock of this CPU runs at 3GHz, find the following
How many operations of each of the list above can this CPU perform in 5 minutes?
If we have a set of operations that contains 10^9 of each operation in the list in part 1, compute the required time in seconds to execute the set. Please explain the formula used.
In: Computer Science