import "purchase"
- func CalculateResellPrice(originalPrice, age float64) float64
- func ChooseVehicle(option1, option2 string) string
- func NeedsLicense(kind string) bool
func CalculateResellPrice
func CalculateResellPrice(originalPrice, age float64) float64
CalculateResellPrice calculates how much a vehicle can resell for at a certain age.
Example
{
fmt.Println(CalculateResellPrice(1000, 1))
fmt.Println(CalculateResellPrice(1000, 5))
fmt.Println(CalculateResellPrice(1000, 15))
}
800
700
500
func ChooseVehicle
func ChooseVehicle(option1, option2 string) string
ChooseVehicle recommends a vehicle for selection. It always recommends the vehicle that comes first in lexicographical order.
Example
{
fmt.Println(ChooseVehicle("Wuling Hongguang", "Toyota Corolla"))
fmt.Println(ChooseVehicle("Volkswagen Beetle", "Volkswagen Golf"))
}
Toyota Corolla is clearly the better choice.
Volkswagen Beetle is clearly the better choice.
func NeedsLicense
func NeedsLicense(kind string) bool
NeedsLicense determines whether a license is needed to drive a type of vehicle. Only "car" and "truck" require a license.
Generated by gomarkdoc