On Nov 8, 9:40pm, flebber [email protected] wrote:
R is a float given by user input
The meaning of the formula is totally unclear to me. From what you gave
to but greater than Per)
investment rate I would deaire to acheive), R is the ratio of return
main >= per
200 >= 190
varying P will not change the results of your calculations…
lastSuccess = x if main >= per
p = 10.0
it(hoping it would be clearer for another person reading it). So that
| return if not cond
r = 5.0
allocation. There would ultimately be several options with different
and call it to the function.
could be solved with some simple transformations and do not need any
I need to lookup what a transformation is…
This is where I was headed with it…any suggestions apprecaited.
Bank = $500.00 # later to be a running total calculated
def ROIcalc
const = r100 # simplified without X
x += 0.05 while (xconst < per) && (x <= max_x)
puts x <= max_x ? “#{x*100.0}%” : “no answer”
end
def pool
if Bank > 200 then Bank * 0.05
Else 10.00
end
Scenario 1
a = ROIcalc(per = 190, max_x = 0.8, puts “What ratio of return do you
expect?” r = gets.chomp, pool)
b = ROIcalc(per = 200, max_x = 0.4, r = 12.00, pool)
output result if valid
or return no valid result choose another scenario or end.
This is where I was headed.
Bank = $500.00 # later to be a running total calculated
def ROIcalc
const = r100 # simplified without X
x += 0.05 while (xconst < per) && (x <= max_x)
puts x <= max_x ? “#{x*100.0}%” : “no answer”
end
def pool
if Bank > 200 then Bank * 0.05
Else $10.00
end
Scenario 1
a = ROIcalc(per = 190, max_x = 0.8, puts “What ratio of return do you
expect?” r = gets.chomp, pool)
b = ROIcalc(per = 200, max_x = 0.4, r = 12.00, pool)
output result if valid
or return no valid result choose another scenario or end.