Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Calcular o reajuste salarial.
package main
import (
"fmt"
)
func main() {
var salario, aumento, percentual float32
fmt.Print("Salario: ")
fmt.Scan(&salario)
if salario <= 280 {
percentual = 0.20 // 20 % = 20/100 = 0.20
} else if salario > 280 && salario <= 700 {
percentual = 0.15 // 15%
} else if salario > 700 && salario <= 1500 {
percentual = 0.10 // 10 %
} else if salario > 1500 {
percentual = 0.05 // 5%
}
aumento = salario * percentual
fmt.Println("Salário: R$ ", salario)
fmt.Println("Percentual: (%) ", percentual* 100)
fmt.Println("Aumento: R$ ", aumento)
fmt.Println("Novo Salário: R$ ", salario + aumento)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment