From 2da2459bd46a24de9ebb7f2aa323a583dab1b9d1 Mon Sep 17 00:00:00 2001 From: Nenza Nurfirmansyah Date: Thu, 26 Oct 2023 14:07:57 +0700 Subject: [PATCH] add mile & foot to kilometer conversions --- conversions/foot_to_kilometer.dart | 10 ++++++++++ conversions/mile_to_kilometer.dart | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 conversions/foot_to_kilometer.dart create mode 100644 conversions/mile_to_kilometer.dart diff --git a/conversions/foot_to_kilometer.dart b/conversions/foot_to_kilometer.dart new file mode 100644 index 0000000..aa87f5d --- /dev/null +++ b/conversions/foot_to_kilometer.dart @@ -0,0 +1,10 @@ +double footToKilometer(double nums) { + double target = nums * 0.0003048; + print(target.toString()); + + return target; +} + +void main() { + footToKilometer(8.1); +} diff --git a/conversions/mile_to_kilometer.dart b/conversions/mile_to_kilometer.dart new file mode 100644 index 0000000..2e0fc4d --- /dev/null +++ b/conversions/mile_to_kilometer.dart @@ -0,0 +1,10 @@ +double mileToKilometer(double nums) { + double target = nums * 1.60934; + print(target.toString()); + + return target; +} + +void main() { + mileToKilometer(8.1); +}