Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Bajraktarevic_1_Klassen.cpp
- Revision:
- 0:4665482ff54d
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Bajraktarevic_1_Klassen.cpp Sat Mar 28 14:53:38 2020 +0000
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include <iostream>
+
+using namespace std;
+
+namespace RIAD
+{
+enum eckig {ja, nein}; // 0 , 1
+
+class Kreis
+{
+ private:
+ float m_radius;
+ eckig m_hat_ecken;
+
+ public: **konstruktor**deklariren
+ Kreis(eckig x); // neu setzen
+ Kreis(float radius); //xx
+ Kreis();
+ float berechneUmfang();
+ eckig gib_mir_meine_ecken(); //neu geben
+};
+
+Kreis::Kreis(float radius) {
+ m_radius = radius;
+ m_hat_ecken = nein;
+}
+
+Kreis::Kreis() { **konstruktor**implemetiren
+ m_radius = 1;
+ m_hat_ecken = nein;
+}
+Kreis::Kreis(eckig x){ // neu setzen
+ m_radius = 1; // neu setzen
+ m_hat_ecken =x; // neu setzen
+}
+
+float Kreis::berechneUmfang() {
+ return (m_radius * m_radius * 3.1415);}
+
+eckig RIAD::Kreis::gib_mir_meine_ecken(){ //neu
+ return m_hat_ecken; //neu
+}
+
+};
+ //using namespace RIAD;
+int main ()
+{
+
+ RIAD::Kreis meineForm(2.0);
+ float um = meineForm.berechneUmfang();
+ printf ("Der Umfang beträgt: %f\n", um);
+
+ RIAD::Kreis meinKreis();
+ RIAD::eckig my_ecke = RIAD::ja;
+ RIAD::Kreis riadskreis (my_ecke);
+ printf ("Ecken: %d\n", riadskreis);
+
+ RIAD::eckig antwort = riadskreis.gib_mir_meine_ecken();
+ printf ("Antwortt: %d\n", antwort);
+
+ return 0;
+}
\ No newline at end of file