Skip to content

Latest commit

 

History

History
executable file
·
107 lines (72 loc) · 2 KB

purchase-doc.md

File metadata and controls

executable file
·
107 lines (72 loc) · 2 KB

purchase

import "purchase"

Index

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))

}

Output

800
700
500

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"))

}

Output

Toyota Corolla is clearly the better choice.
Volkswagen Beetle is clearly the better choice.

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.

Example

{
	fmt.Println(NeedsLicense("car"))
	fmt.Println(NeedsLicense("bike"))

}

Output

true
false

Generated by gomarkdoc