Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import "fmt"
- func main() {
- var budget float64
- fmt.Scanln(&budget)
- var season string
- fmt.Scanln(&season)
- car := "Jeep"
- carClass := "Luxury class"
- if budget > 500 {
- budget *= 0.90
- } else if budget > 100 {
- if season == "Summer" {
- car = "Cabrio"
- budget *= 0.45
- } else {
- budget *= 0.80
- }
- carClass = "Compact class"
- } else if budget > 0 {
- if season == "Summer" {
- car = "Cabrio"
- budget *= 0.35
- } else {
- budget *= 0.65
- }
- carClass = "Economy class"
- }
- fmt.Printf("%s\n%s - %.2f\n", carClass, car, budget)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement