
PS
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form
$form.Text = "Decimal to Quinary Converter"
$form.Size = New-Object System.Drawing.Size(400,200)
$form.StartPosition = "CenterScreen"
$labelInput = New-Object System.Windows.Forms.Label
$labelInput.Text = "Enter Decimal Number:"
$labelInput.Location = New-Object System.Drawing.Point(20,20)
$labelInput.Size = New-Object System.Drawing.Size(150,20)
$form.Controls.Add($labelInput)
$textboxDecimal = New-Object System.Windows.Forms.TextBox
$textboxDecimal.Location = New-Object System.Drawing.Point(180,20)
$textboxDecimal.Size = New-Object System.Drawing.Size(180,20)
$form.Controls.Add($textboxDecimal)
$labelOutput = New-Object System.Windows.Forms.Label
$labelOutput.Text = "Quinary Value:"
$labelOutput.Location = New-Object System.Drawing.Point(20,60)
$labelOutput.Size = New-Object System.Drawing.Size(150,20)
$form.Controls.Add($labelOutput)
$textboxQuinary = New-Object System.Windows.Forms.TextBox
$textboxQuinary.Location = New-Object System.Drawing.Point(180,60)
$textboxQuinary.Size = New-Object System.Drawing.Size(180,20)
$textboxQuinary.ReadOnly = $true
$form.Controls.Add($textboxQuinary)
$buttonConvert = New-Object System.Windows.Forms.Button
$buttonConvert.Text = "Convert"
$buttonConvert.Location = New-Object System.Drawing.Point(140,100)
$buttonConvert.Size = New-Object System.Drawing.Size(100,30)
$form.Controls.Add($buttonConvert)
$buttonConvert.Add_Click({
$decimalInput = $textboxDecimal.Text
if ([int]::TryParse($decimalInput, [ref]$null)) {
$decimalNumber = [int]$decimalInput
$quinary = ""
if ($decimalNumber -eq 0) {
$quinary = "0"
} else {
while ($decimalNumber -gt 0) {
$quinary = ($decimalNumber % 5).ToString() + $quinary
$decimalNumber = [math]::Floor($decimalNumber / 5)
}
}
$textboxQuinary.Text = $quinary
} else {
[System.Windows.Forms.MessageBox]::Show("Please enter a valid integer.", "Error")
}
})
# Show form
[void]$form.ShowDialog()
or
do 6 numbers at once

Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
$form = New-Object System.Windows.Forms.Form
$form.Text = "Decimal to Quinary Converter"
$form.Size = New-Object System.Drawing.Size(450,220)
$form.StartPosition = "CenterScreen"
$labelInput = New-Object System.Windows.Forms.Label
$labelInput.Text = "Enter up to 6 Decimal Numbers (comma-separated):"
$labelInput.Location = New-Object System.Drawing.Point(20,20)
$labelInput.Size = New-Object System.Drawing.Size(400,20)
$form.Controls.Add($labelInput)
$textboxDecimal = New-Object System.Windows.Forms.TextBox
$textboxDecimal.Location = New-Object System.Drawing.Point(20,45)
$textboxDecimal.Size = New-Object System.Drawing.Size(390,20)
$form.Controls.Add($textboxDecimal)
$labelOutput = New-Object System.Windows.Forms.Label
$labelOutput.Text = "Quinary Values:"
$labelOutput.Location = New-Object System.Drawing.Point(20,80)
$labelOutput.Size = New-Object System.Drawing.Size(150,20)
$form.Controls.Add($labelOutput)
$textboxQuinary = New-Object System.Windows.Forms.TextBox
$textboxQuinary.Location = New-Object System.Drawing.Point(20,105)
$textboxQuinary.Size = New-Object System.Drawing.Size(390,20)
$textboxQuinary.ReadOnly = $true
$form.Controls.Add($textboxQuinary)
$buttonConvert = New-Object System.Windows.Forms.Button
$buttonConvert.Text = "Convert"
$buttonConvert.Location = New-Object System.Drawing.Point(170,140)
$buttonConvert.Size = New-Object System.Drawing.Size(100,30)
$form.Controls.Add($buttonConvert)
$buttonConvert.Add_Click({
$input = $textboxDecimal.Text
$numbers = $input -split "," | ForEach-Object { $_.Trim() }
if ($numbers.Count -gt 6) {
[System.Windows.Forms.MessageBox]::Show("Please enter no more than 6 numbers.", "Too Many Numbers")
return
}
$quinaryResults = @()
foreach ($n in $numbers) {
if ([int]::TryParse($n, [ref]$null)) {
$decimalNumber = [int]$n
if ($decimalNumber -eq 0) {
$quinaryResults += "0"
} else {
$quinary = ""
while ($decimalNumber -gt 0) {
$quinary = ($decimalNumber % 5).ToString() + $quinary
$decimalNumber = [math]::Floor($decimalNumber / 5)
}
$quinaryResults += $quinary
}
} else {
$quinaryResults += "Invalid"
}
}
$textboxQuinary.Text = ($quinaryResults -join ", ")
})
# Show form
[void]$form.ShowDialog()