SuperTutor

(15)

$15/per page/Negotiable

About SuperTutor

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Business & Finance See all
Accounting,Business & Finance,Economics,Engineering,HR Management,Math Hide all
Teaching Since: Apr 2017
Last Sign in: 327 Weeks Ago, 4 Days Ago
Questions Answered: 12843
Tutorials Posted: 12834

Education

  • MBA, Ph.D in Management
    Harvard university
    Feb-1997 - Aug-2003

Experience

  • Professor
    Strayer University
    Jan-2007 - Present

Category > Programming Posted 18 May 2017 My Price 8.00

Value max(FindOptimalPlanValue

if n == 1 then
Value max(l[n], h[n])
else if n == 2 then
Value max(FindOptimalPlanValue(1, l, h)+ l[2], h[2])
else
Value max(FindOptimalPlanValue(n − 1, l, h) + l[n],FindOptimalPlanValue(n − 2, l, h) + h[n])
end if
return Value
FindOptimalValue(n, l, h)
Initialization:
for i = 1 ! n do
Value[i] = 0
end for
for i = 1 ! n do
if i == 1 then
Value[i] max(l[i], h[i])
else if i == 2 then
Value[i] max(Value[1] + l[2], h[2])
else
Value[i] max(Value[i − 1] + l[i], Value[i − 2] + h[i])
end if
end for
return Value[n]
FindOptimalPlan(n, l, h, Value)
Initialization:
for i = 1 ! n do
Weeks[i] "Do nothing"
end for
if Value[n] − l[n] = Value[n − 1] then
Weeks[n] "Low stress"
FindOptimalPlan(n-1, l, h, Value)
else
Weeks[n] "High stress"
FindOptimalPlan(n-2, l, h, Value)
end if
return Weeks

 

Please provide me an executable program for the above code... The problem is present in Photo attached.

Answers

(15)
Status NEW Posted 18 May 2017 04:05 AM My Price 8.00

-----------

Not Rated(0)