Created
March 4, 2022 00:15
-
-
Save samueltcsantos/ab6559def41e4540a18f36f215e1d28a to your computer and use it in GitHub Desktop.
Calcular o reajuste salarial.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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