struct NuclearRocket {
var meters: Double
var liters: Double
init(meters: Double, liters: Double) {
self.meters = meters
self.liters = liters
}
// Init for
init(ft: Double, gallon: Double) {
let convertedMeters = ft / 3.28
let convertedLitter = gallon * 3.78
self.init(meters: convertedMeters, liters: convertedLitter)
}
}
let asdf = NuclearRocket(ft: 1, gallon: 1)
asdf.liters
asdf.meters
thats a.l good for converting feet to metric but how would I switch from metric to feet in the same struct?