Part I: (Short Answer)
1. In Java, what are the three different ways you can implement an interface?
2. Discuss examples of “is-a” and “has-a” relationships and possible Java implementations.
3. When is it appropriate to use the various techniques for handling exceptions?
4. When is it appropriate to use an applet?
5. Discuss how to convert a GUI application into an applet.
First International Resource Management, Inc. (aka. FIRM) asks you to develop programs to solve the
following problem.
FIRM pays its employees on a weekly basis. FIRM has four types of employees: salaried employees, who are paid a fixed weekly salary regardless of the number of hours worked; hourly employees, who are paid by the hour and receive overtime pay; commission employees, who are paid a percentage of their sales; and salaried-commission employees, who receive a base salary plus a percentage of their sales. FIRM wants to implement a java application that performs its payroll calculations polymorphically. Of course each employ belongs to a department.
Based on the description of the problem and several discussions with the client, a class diagram is agreed upon and the class hierarchy is shown in the diagram. At first, the management wants to see a GUI application about three employee types: HourlyEmployee, SalariedEmployee, and CommissionEmployee.
Development of Classes and an Interface
Employee: abstract super class
Attributes:
· Employee name: String
Methods:
· Constructor: with one parameter of employee name
· Get and set methods for the attribute
· earnings(): Abstract method that will return a double value
SalariedEmployee: subclass of Employee
Additional Attribute:
· weeklySalary: double
Methods:
· Constructor: with two parameters of employee name and weekly salary
· Constructor: with one parameter of employee name, and default salary is $800.
· Get and set methods for weeklySalary
· earnings(): return weekly salary
HourlyEmployee: subclass of Employee
Addition Attributes:
· wage: double
· hours: double
Methods:
· Constructor: with three parameters of employee name, wage, and hours
· Constructor: with two parameters of employee name and hours, default wage is $8.
· Get and set methods for wage and hours
· earnings(): if the employee worked overtime (hours>40), the overtime portion is paid half timemore than regular wage.
CommissionEmployee: subclass of Employee
Additional Attribute:
· grossSales: double
· commissionRate: double
Methods:
· Constructor: with three parameters of employee name, gross sales, and commission rate.
· Constructor: with two parameters of employee name and gross sales, and default rate is 0.05.
· Get and set for grossSales and commissionRate
· earnings(): commission is calculated as gross sales times commission rate.
BasePlusCommissionEmployee: subclass of CommissionEmployee, do not worry about it for this home work.
All the classes also need to have a method to print out pay check, which will show company name, basic i.
Part I (Short Answer)1. In Java, what are the three different w.docx
1. Part I: (Short Answer)
1. In Java, what are the three different ways you can implement
an interface?
2. Discuss examples of “is-a” and “has-a” relationships and
possible Java implementations.
3. When is it appropriate to use the various techniques for
handling exceptions?
4. When is it appropriate to use an applet?
5. Discuss how to convert a GUI application into an applet.
First International Resource Management, Inc. (aka. FIRM) asks
you to develop programs to solve the
following problem.
FIRM pays its employees on a weekly basis. FIRM has four
types of employees: salaried employees, who are paid a fixed
weekly salary regardless of the number of hours worked; hourly
employees, who are paid by the hour and receive overtime pay;
commission employees, who are paid a percentage of their
sales; and salaried-commission employees, who receive a base
salary plus a percentage of their sales. FIRM wants to
implement a java application that performs its payroll
calculations polymorphically. Of course each employ belongs to
a department.
Based on the description of the problem and several discussions
with the client, a class diagram is agreed upon and the class
hierarchy is shown in the diagram. At first, the management
wants to see a GUI application about three employee types:
HourlyEmployee, SalariedEmployee, and CommissionEmployee.
2. Development of Classes and an Interface
Employee: abstract super class
Attributes:
· Employee name: String
Methods:
· Constructor: with one parameter of employee name
· Get and set methods for the attribute
· earnings(): Abstract method that will return a double value
SalariedEmployee: subclass of Employee
Additional Attribute:
· weeklySalary: double
Methods:
· Constructor: with two parameters of employee name and
weekly salary
· Constructor: with one parameter of employee name, and
default salary is $800.
· Get and set methods for weeklySalary
· earnings(): return weekly salary
HourlyEmployee: subclass of Employee
Addition Attributes:
· wage: double
· hours: double
Methods:
· Constructor: with three parameters of employee name, wage,
and hours
· Constructor: with two parameters of employee name and
hours, default wage is $8.
· Get and set methods for wage and hours
· earnings(): if the employee worked overtime (hours>40), the
3. overtime portion is paid half timemore than regular wage.
CommissionEmployee: subclass of Employee
Additional Attribute:
· grossSales: double
· commissionRate: double
Methods:
· Constructor: with three parameters of employee name, gross
sales, and commission rate.
· Constructor: with two parameters of employee name and gross
sales, and default rate is 0.05.
· Get and set for grossSales and commissionRate
· earnings(): commission is calculated as gross sales times
commission rate.
BasePlusCommissionEmployee: subclass of
CommissionEmployee, do not worry about it for this home
work.
All the classes also need to have a method to print out pay
check, which will show company name, basic information of the
employee, and earnings of the current week. An interface class
Company is used for the purpose and all the employee types
will implement this interface.
Company: interface
Attribute:
· Company name: First International Resource Management,
Inc.
Methods:
· tellAboutSelf()
Graphic User Interface
4. To make things easier at the beginning, only take into account
of SalariedEmployee,
CommissionEmployee, and HourlyEmplyee.
You can have your own design of the window interface.
Basically, the interface will allow user to inputbasic
information of an employee, calculate earnings, and show a
paycheck.
· The interface checks the valid input, e.g., name should not be
empty, and salary should benumeric, and inputs should be in
reasonable range (such as hours is great than 0 and not
greatthan 168) so on. For numeric input and valid range, please
use Exception handling. You may need to create your
exceptions.
· The interface allows user to use default values. If a field is
left blank, the program shouldshow appropriate default value.
· Clicking Add will create an employee object and show a
successful message.
· After adding an employee, clicking Earn button will show the
earning of the employee in amessage.
· Clicking Print will show a message box that contains paycheck
information.
· Clicking Clear will reset text fields to be blank.
· Clicking Close will shutdown the program.
Interface for Salary Employee:
After inputting data and clicking Add.
After clicking Earn (please only click Earn after a succesful
Add.)
After clicking Print
5. Interface for Commision Employee:
Interface for Hourly Employee:
When Hours is not valid, a message is shown.
Following information can be used as testing data. When testing
6. your program, try all kinds of things to break it. Then fix it.
Employee
Type
Avery Tolar
Salary
Salary is 1000
Tammy Hemphill
Commission Employee
Gross sales = 14500, default rate
Wayne Tarrance
Hourly employee
Worked 55 hours last week, default wage
Problem 20Ending Inventory BalanceMonthly SalesThese are
the two variables that you need to answer problem
20.15445053Copy and paste them into
Minitab.1913505220287507117828871554388019104454120838
55246788242021015716
Problem 19ResidualsThese are the residuals referred to in
problem 19.-24You may copy and paste them into Minitab if
you wish.-348-892-62-378-489-3423449023578198
Problems 21 through 30SalesThis is monthly data to be used to
answer questions 21 through 30.6028Load it into Minitab before
you take the
exam.592710515322765192031294235733646518959139181798
71529416850127532690161494147862579905131853599230384
13961933022707153953082625589103184197608686003990991
36858781596793344353719277733665351157217509206229110
08110289312885710477611103663701826573141648341856512
42673289554164373160608176096142363114907113552127042
51604803662089382638302522162195661490822138881789471
33650116946164154588438238622480335430132826331364721
45613371921834821446181397501845467104315293025055940
7. 9567394747272874230303375402195409173518181702258713
Chapter 5 : Chapter 5 - Exam 1
Top of Form
YOU NEED TO HAVE MINITAB TO COMPLETE THIS
ASSIGNMENT
Eco 309 Exam 1 (Chapter 1 through 5)
You will have 2 and 1/2 hours to complete the 30 multiple
choice questions. This exam must be completed. I suggest that
you complete the exam within one session to prevent the loss of
your answers. You must take this exam since there will be no
make-up tests.
The excel data for this test may be downloaded from Doc
Sharing under Exam 1 Data and can be copied and pasted
directly into Minitab. I suggest that you download the data
before you begin the exam.
Be sure to select the best answer for each question and do not
leave any questions unanswered.
1.
You are given only three quarterly seasonal indices and
quarterly seasonally adjusted data for the entire year. What is
the raw data value for Q4? Raw data is not adjusted for
seasonality.
Quarter Seasonal Index Seasonally Adjusted Data
Q1 .80 295
Q2 .85 299
Q3 1.15 270
Q4 --- 271
(Points : 3)
325
225
8. 252
271
2. One model of exponential smoothing will provide almost the
same forecast as a liner trend method. What are linear trend
intercept and slope counterparts for exponential
smoothing? (Points : 3)
Alpha and Delta
Delta and Gamma
Alpha and Gamma
Std Dev and Mean
3. Why is the residual mean value important to a
forecaster? (Points : 3)
Large mean values indicate nonautoregressiveness.
Small mean values indicate the total amount of error is
small.
Large absolute mean values indicate estimate bias.
Large mean values indicate the standard error of the model
is small.
4. When performing correlation analysis what is the null
hypothesis? What measure in Minitab is used to test it and to
be 95% confident in the significance of correlation
coefficient. (Points : 3)
Ho: r = .05 p < .5
Ho: r = 1 p =.05
9. Ho: r ≠ 0 p≤.05
Ho: r = 0 p≤.05
5. In decomposition what does the cycle factor (CF) of .80
represent for a monthly forecast estimate of a Y
variable? (Points : 3)
The estimated value is 80% of the average monthly
seasonal estimate.
The estimate is .80 of the forecasted Y trend value.
The estimated value is .80 of the historical average CMA
values.
The estimated value has 20% more variation than the
average historical Y data values.
6. A Burger King franchise owner notes that the sales per store
has fallen below the stated national Burger King outlet average
of $1,258,000. He asserts a change has occurred that reduced
the fast food eating habits of Americans. What is his
hypothesis (H1) and what type of test for significance must be
applied? (Points : 3)
H1: u ≥ $1.258,000 A one-tailed t-test to the left.
H1: u = $1.258,000 A two-tailed t-test.
H1: u < $1.258,000 A one-tailed t-test to the left.
H1: p < $1.258,000 A one-tailed test to the right.
7.
The CEO of Home Depot wants to see if city size has any
relationship to the current profit margins of the company
stores. What data type will he likely use to determine this?
(Points : 3)
Time series data of profits by store.
10. Recent 10 year sample of profits by stores.
Recent cross section of store profits by city.
Trend of a random sample of store profits over time.
8. Sometimes forecasters get lazy or forgetful and do not check
the significance of XY data correlations and use the X variable
to forecast Y. What is the result of this? (Points : 3)
Type 2 error
Autocorrelation error
Type 3 error
Type 1 error
9. In exponential smoothing what is the weight of the alpha
coefficient for a time series data observation from the
3rd previous period if the original alpha value is set at .3?
(Points : 3)
The weight cannot be calculated since the data observation
is not given.
The weight is zero since the alpha value is set relatively
high.
.125
.103
.084
10. What is not a characteristic of a random data series? (Points
: 3)
Zero mean with an normal distribution.
ACF LBQ values less than .05.
Non autoregressive observations
Central tendency
11. What is the major cause of non randomness
11. (autoregressiveness) in business data? (Points : 3)
Randomness only occurs for short time periods.
Random events such as storms or technologies offset over
the long run.
Measurements naturally increase or decrease over time.
Business participant’s decisions and work.
12. Which form of exponential smoothing can result in a naïve
forecast? (Points : 3)
Winters with a very low seasonal coefficient.
Simple with a very low trend coefficient.
Simple with a very high alpha value.
Double with a very low alpha value.
13. What statistical characteristic enables forecasters to move
from uncertainty to quantifiable low risk in the business
forecasting process? (Points : 3)
Large amounts of available business data naturally create
statistical accuracy.
Although business data are not normally distributed the
statistics from the data are normally distributed.
Statistical forecasting technology has improved the
accuracy of models.
Statistical t and p-values always reflect the data
population.
14. What is used to determine the forecast model confidence
level for Exponential Smoothing and Decomposition
models? (Points : 3)
The significance level of the smoothing constants
The error measures
12. The residual LBQ Chi-Square values
The mean of the residuals
15. You are responsible for forecasting your company’s
revenues for the next 24 months. You have three years of
historical monthly data and previous forecasts that indicate that
the company revenues with no obvious seasonality have grown
significantly over that time. Which forecast method would you
apply to the problem?(Points : 3)
3 period moving average
12 period moving average
Simple exponential smoothing
Double exponential smoothing
16. You obtained a correlation coefficient from two data series
that indicates a p-value of .97. Can you be 95% confident that
the correlation is significantly different from zero? (Points : 3)
Yes, since the p value is above the confidence level.
Yes, since the p value is above 1 minus the confidence
level.
No, since the p-value is above the 1 minus the confidence
level.
No, since the data is not provided to determine true
confidence.
17. In decomposition the seasonal indices are the period
relationships between what two data series? (Points : 3)
Seasonal moving averages and the trend data series.
Smoothed data from centered moving averaging and the
original data series.
Trend data and the cycle factors.
Trend data and the original data series.
13. 18. If sales growth and market penetration for a new product are
expected to occur rapidly due to low product price and “need to
have” technology which forecast model would you apply?
(Points : 3)
Logistics S-curve
Gompertz S-curve
3 period Moving Averages
Double Exponential Smoothing
19. You have forecast the sales for your company for the last 12
months and the forecast residuals are shown below. Are these
residuals to be considered random? (This data also appears in
the Doc Sharing excel worksheet download for Exam 1 Data
under the Problem 19 tab.)
Residuals
-24
-348
-892
-62
-378
-489
-342
34
490
23
578
198 (Points : 4)
Yes, since the residuals randomly vary in magnitude.
Yes since the residuals are positive and negative and vary
in magnitude.
No, since the residuals are stationary and vary in
magnitude.
No, since the residuals indicate positive slope.
14. 20.
Given the data series below for variables Y (Monthly Inventory
Balance) and X (Monthly Sales) are they significantly
correlated at the 95% confidence level and how can you tell?
(This data also appears in the docsharing download for Exam 1
Data excel worksheet under the Problem 20 tab.)
Ending Inv. Bal. Y
Monthly Sales X
1544
5053
1913
5052
2028
7507
1178
2887
1554
3880
1910
4454
1208
3855
2467
8824
2101
15. 5716
(Points : 4)
Yes. The correlation coefficient is .873 that is greater than
.05.
Yes. The correlation p-value is .002 which is less than .05.
No. The correlation coefficient is above the p-value.
No. The correlation p-value is greater than the 95%
confidence level.
21.
From the monthly sales data series below which exponential
smoothing model would you apply? (This data also appears in
the docsharing excel worksheet download for Exam 1 under the
problem 21 through 30 tab.)
Sales
6028
5927
10515
32276
51920
31294
23573
36465
18959
13918
17987
15294
16850
12753
26901
61494
147862
57990
51318
53599
18. 195409
173518
181702
258713
(Points : 4)
Simple
Double
Winters
Moving Averages
22. Run the data with the exponential smoothing model that
applies and obtain the best model by adjusting each of the
coefficients. (Make sure that you only use one decimal place
for each coefficient – e.g. .1, or .2, or .3 …. to .9.) What
coefficient value for Alpha will result in the best exponential
smoothing result in the model selected? (Points : 4)
.1
.5
.9
.2
23. What is the RMSE for the Fit period for the best exponential
smoothing model? (Points : 4)
22634
38693
12971
20
24. Use the best exponential smoothing model to generate a
forecast for 12 months. What is the forecast value for the
12th month? (Points : 4)
280762
19. 85095
250981
46840
25. Are the residuals from the best exponential smoothing
model random and how can you tell? (Points : 4)
No, since they still have significant seasonality.
No, since they still have significant trend.
Yes, since they are normally distributed with a near zero
mean.
Yes, since none of the residuals is significantly
autoregressive.
26. Use the same monthly sales data series and run a
decomposition model and estimate 12 forecast periods. Which
month has the greatest seasonal sales? (Points : 4)
Month 1
Month 12
Month 4
Month 5
27. What is the MAPE for the decomposition model? (Points :
3)
24%
22%
29%
24341
28. What is the forecast value for the 12th period (last forecast
month). Do not adjust if for cycle factors. (Points : 4)
87838
221239
20. 353622
181473
29.
Are the decomposition residuals random? Why or why not?
(Points : 4)
No. They still have seasonality.
No. They still have significant trend.
Yes. They are normally distributed with a near zero mean.
Yes. None of the residuals are significantly autoregressive.
30. What is the forecast value for the 12th period (last forecast
month) adjusted for cycle? (Points : 3)
223746
353622
665423
282712
Bottom of Form