all tasks
This commit is contained in:
parent
b83f433714
commit
68f8f3e56b
14735 changed files with 178959 additions and 0 deletions
|
|
@ -0,0 +1,52 @@
|
|||
Procedure.d f(x.d)
|
||||
ProcedureReturn Pow(Abs(x), 0.5) + 5 * x * x * x
|
||||
EndProcedure
|
||||
|
||||
Procedure split(i.s, delimeter.s, List o.d())
|
||||
Protected index = CountString(i, delimeter) + 1 ;add 1 because last entry will not have a delimeter
|
||||
|
||||
While index > 0
|
||||
AddElement(o())
|
||||
o() = ValD(Trim(StringField(i, index, delimeter)))
|
||||
index - 1
|
||||
Wend
|
||||
|
||||
ProcedureReturn ListSize(o())
|
||||
EndProcedure
|
||||
|
||||
Define i$, entriesAreValid = 0, result.d, output$
|
||||
NewList numbers.d()
|
||||
|
||||
If OpenConsole()
|
||||
Repeat
|
||||
PrintN(#crlf$ + "Enter eleven numbers that are each separated by spaces or commas:")
|
||||
|
||||
i$ = Input(
|
||||
i$ = Trim(i$)
|
||||
If split(i$, ",", numbers.d()) < 11
|
||||
ClearList(numbers())
|
||||
If split(i$, " ", numbers.d()) < 11
|
||||
PrintN("Not enough numbers were supplied.")
|
||||
ClearList(numbers())
|
||||
Else
|
||||
entriesAreValid = 1
|
||||
EndIf
|
||||
Else
|
||||
entriesAreValid = 1
|
||||
EndIf
|
||||
Until entriesAreValid = 1
|
||||
|
||||
ForEach numbers()
|
||||
output$ = "f(" + RTrim(RTrim(StrD(numbers(), 3), "0"), ".") + ") = "
|
||||
result.d = f(numbers())
|
||||
If result > 400
|
||||
output$ + "Too Large"
|
||||
Else
|
||||
output$ + RTrim(RTrim(StrD(result, 3), "0"), ".")
|
||||
EndIf
|
||||
PrintN(output$)
|
||||
Next
|
||||
|
||||
Print(#crlf$ + #crlf$ + "Press ENTER to exit"): Input()
|
||||
CloseConsole()
|
||||
EndIf
|
||||
Loading…
Add table
Add a link
Reference in a new issue