Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class UnitConverter {
- public func LiterToMilliliter(withLiterValue L: Int) -> Int {
- return L*1000
- }
- public func MilliliterToLiter(withMilliliterValue ML: Int) -> Int {
- return ML/1000
- }
- public func GallonToLiter(withGallonValue G: Int) -> Int {
- return G*Int(4.546)
- }
- public func LiterToGallon(withLiterValue L: Int) -> Int {
- return L/Int(4.546)
- }
- public func KilometerToMetre(withKilometerValue KM: Int) -> Int {
- return KM*1000
- }
- public func MetreToKilometer(withMeterValue M: Int) -> Int {
- return M/1000
- }
- public func MetreToCentimetre(withMetreValue M: Int) -> Int {
- return M*100
- }
- public func CentimetreToMetre(withCentimetreValue CM: Int) -> Int {
- return CM/100
- }
- public func GigaToMega(withGigaValue GAGA: Int) -> Int {
- return GAGA*1000
- }
- public func MegaToGiga(withMegaValue Mega: Int) -> Int {
- return Mega/1000
- }
- public func TeraToGiga(withTeraValue T: Int) -> Int {
- return T*1000
- }
- public func GigaToTera(withGigaValue GAGA: Int) -> Int {
- return GAGA/1000
- }
- public func MegaToKilo(withMegaValue Mega: Int) -> Int {
- return Mega*1000
- }
- public func KiloToMega(withKiloValue K: Int) -> Int {
- return K/1000
- }
- public func CelsiusToKelvin(withCelsiusValue C: Int) -> Int {
- return C+273
- }
- public func KelvinToCelsius(withKelvinValue K: Int) -> Int {
- return K-273
- }
- public func CelsiusToFahrenheit(withCelsiusValue C: Int) -> Int {
- return (C*9/5)+32
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement