Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "strings"
- )
- func main() {
- var fuel string
- fmt.Scanln(&fuel)
- var liters float64
- fmt.Scanln(&liters)
- if (fuel == "Diesel" || fuel == "Gasoline" || fuel == "Gas") {
- if (liters >= 25) {
- fmt.Printf("You have enough %s.\n", strings.ToLower(fuel))
- } else {
- fmt.Printf("Fill your tank with %s!\n", strings.ToLower(fuel))
- }
- } else {
- fmt.Println("Invalid fuel!")
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement