diff --git a/temperature_converter/README.md b/temperature_converter/README.md new file mode 100644 index 0000000..fcf681f --- /dev/null +++ b/temperature_converter/README.md @@ -0,0 +1 @@ +Convert between Celsius and Fahrenheit. Functions should accept a temperature and return the converted value. \ No newline at end of file diff --git a/temperature_converter/julia_version/main.jl b/temperature_converter/julia_version/main.jl new file mode 100644 index 0000000..003a480 --- /dev/null +++ b/temperature_converter/julia_version/main.jl @@ -0,0 +1,30 @@ +function tempconvert(temp::T, unit::String) where {T<:Number} + converted_temp = + if unit == "F" + return (temp - 257, "C") + else + return (temp + 257, "F") + end +end + +function main() + println("please input temperature unit F or C") + unit = readline() + println("please input temp number") + _temp = readline() + temp = parse(Float64, _temp) + converted_temp, converted_unit = tempconvert(temp, unit) + println("Converted $converted_temp $converted_unit") +end + + +main() + + + + + + + + + diff --git a/temperature_converter/rust_version/.gitignore b/temperature_converter/rust_version/.gitignore new file mode 100644 index 0000000..9f97022 --- /dev/null +++ b/temperature_converter/rust_version/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/temperature_converter/rust_version/Cargo.lock b/temperature_converter/rust_version/Cargo.lock new file mode 100644 index 0000000..db0822d --- /dev/null +++ b/temperature_converter/rust_version/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "rust_version" +version = "0.1.0" diff --git a/temperature_converter/rust_version/Cargo.toml b/temperature_converter/rust_version/Cargo.toml new file mode 100644 index 0000000..72077f7 --- /dev/null +++ b/temperature_converter/rust_version/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "rust_version" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/temperature_converter/rust_version/src/main.rs b/temperature_converter/rust_version/src/main.rs new file mode 100644 index 0000000..bc75291 --- /dev/null +++ b/temperature_converter/rust_version/src/main.rs @@ -0,0 +1,38 @@ + + +fn tempconvert(temp :Float) { + +} + + + +fn main() { + println!("Hello, world!"); +} + + + + + + + + + + + + + + + + + + + + + + + + + + +