This sounds very much like a homework assignment but I'll answer it anyway...
let x = number entered by user
let y = x / 10.56
display y
let t = frL or frR (odd (frL) or even (frR) number entered by user)
let z = y + t
display z
constraints -
1.
if t is an odd number, then z must be odd, (rounded to closest odd number)
else, if t is even then z must be even (round to closest even #)
2. z must be greater than or equal to t
Thanks to anyone who can assist!!
Let's see here:
let x = number entered by user
let y = x / 10.56
display y
Code:
Dim x as Integer
Dim y as Integer
x = InputBox("Enter first Number", "Number1")
' Insert check to confirm input is actually a number before passing to y!
' It may be best to use x as String and then convert input to a number...
y = int(x / 10.56)
msgbox("The result is: " & y)
And then
let t = frL or frR (odd (frL) or even (frR) number entered by user)
let z = y + t
display z
Code:
Dim t as Integer
Dim u as Integer
Dim z as Integer
t = Inputbox("Enter Second Number", "Number2")
' As above, confirm input is actually a number!
u = t mod 2
If (u = 0) then MsgBox("Your Number is Even")
Else MsgBox("Your Number is Odd")
Endif
' For z to be the same odd or even as t, then y must be even:
If y mod 2 == 0 then y= y + 1
z = t + y
MsgBox("Your Final number is: " & z)
I think that should be correct...