This commit is contained in:
2024-10-17 00:39:02 +00:00
parent d357447e78
commit 0d716f8255
4 changed files with 80 additions and 0 deletions

33
profitCalculator/app.go Normal file
View File

@@ -0,0 +1,33 @@
package main
import "fmt"
func main() {
var revenue float64
var expenses float64
var taxRate float64
fmt.Print("Revenue: ")
fmt.Scan(&revenue)
fmt.Print("Expenses: ")
fmt.Scan(&expenses)
fmt.Print("Tax Rate: ")
fmt.Scan(&taxRate)
ebt := revenue - expenses
profit := ebt * (1 - taxRate/100)
ratio := ebt / profit
fmt.Println(ebt)
fmt.Println(profit)
fmt.Println(ratio)
}
func getUserInput(infoText string) float64 {
var userInput float64
fmt.Print(infoText)
fmt.Scan(&userInput)
return userInput
}

3
profitCalculator/go.mod Normal file
View File

@@ -0,0 +1,3 @@
module example.com/profit-calculator
go 1.23.1