From 1b6aabc1b500a744686ff25ce8586eecce90b37a Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Tue, 6 Feb 2024 18:40:58 +0100 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=8D=BB=20More=20excercise=20files?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/excercises/celsius.cc | 15 +++++++++++++++ src/excercises/circles.cc | 15 +++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/excercises/celsius.cc create mode 100644 src/excercises/circles.cc diff --git a/src/excercises/celsius.cc b/src/excercises/celsius.cc new file mode 100644 index 0000000..4c44914 --- /dev/null +++ b/src/excercises/celsius.cc @@ -0,0 +1,15 @@ + +#include + +using namespace std; + +int main() { + + int fahrenheit; + cout << "Enter fahrenheit value: "; + cin >> fahrenheit; + double celsius = (fahrenheit - 32) / 1.8; + cout << "Celsius: " << celsius; + + return 0; +} diff --git a/src/excercises/circles.cc b/src/excercises/circles.cc new file mode 100644 index 0000000..64e476e --- /dev/null +++ b/src/excercises/circles.cc @@ -0,0 +1,15 @@ +#include +#include + +using namespace std; + +int main() { + + int radius; + cout << "Enter radius of circle: "; + cin >> radius; + + // I'm awesome, the teacher didn't know about the PI constant in cmath + cout << "Result: " << M_PI * pow(radius, 2); + return 0; +} From 32c530ced1938205fdc14b22d899b98a080c0772 Mon Sep 17 00:00:00 2001 From: "Simon V. Lejel" Date: Tue, 6 Feb 2024 18:41:13 +0100 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=8F=97=EF=B8=8F=20Make=20main=20file?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/main.cc diff --git a/src/main.cc b/src/main.cc new file mode 100644 index 0000000..0bcfa04 --- /dev/null +++ b/src/main.cc @@ -0,0 +1,10 @@ +#include + +using namespace std; + +int main() { + + + + return 0; +}