I startet with Powershell and tried to do a simple calculator.
This is what I have:
Function ReturnRes ($x,$y,$z)
{
$res= [float] $z [float]$y
return $res
}
Write-Host $res
$var1 = Read-Host "Zahl1"
$var2 = Read-Host "Zahl2"
$op = Read-Host "Operator(+-*/)"
ReturnRes -x $var1 -y $var2 -z $op
But I can't use the $z
variable as an operation...
Any ideas?