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.
Mesic_Klassen_1.cpp
00001 00002 #include <stdio.h> 00003 #include <iostream> 00004 using namespace std; 00005 00006 enum eckig { ja, nein}; 00007 00008 namespace Mesic 00009 { 00010 class Kreis 00011 { 00012 private: 00013 float m_radius; 00014 eckig m_hat_ecken; 00015 00016 public: 00017 float berechneUmfang(); 00018 float berechneFlaeche(); 00019 eckig eckingauslesen(); 00020 00021 Kreis(float radius); 00022 Kreis(float radius, eckig hat_ecken); 00023 00024 Kreis(); 00025 }; 00026 00027 } 00028 00029 using namespace Mesic; 00030 Kreis::Kreis(float radius) 00031 { 00032 m_radius = radius; 00033 m_hat_ecken = nein; 00034 } 00035 00036 Kreis::Kreis(float radius,eckig hat_ecken) 00037 { 00038 m_radius = radius; 00039 m_hat_ecken = nein; 00040 } 00041 00042 Kreis::Kreis() 00043 { 00044 m_radius = 0; 00045 m_hat_ecken = nein; 00046 } 00047 00048 float Kreis::berechneUmfang() 00049 { 00050 return (m_radius * m_radius * 3.1415); 00051 } 00052 00053 eckig Kreis::eckingauslesen() 00054 { 00055 return(m_hat_ecken); 00056 } 00057 00058 00059 00060 00061 int main () 00062 { 00063 00064 00065 eckig eck; 00066 00067 00068 Kreis meineForm(2.0); 00069 00070 00071 float um = meineForm.berechneUmfang(); 00072 00073 printf ("Der Umfang beträgt: %f\n", um); 00074 00075 eck=meineForm.eckingauslesen(); 00076 00077 if(eck==0) 00078 printf ("Es ist eckig\n"); 00079 else if(eck==1) 00080 printf("Es ist nicht eckig\n"); 00081 00082 return 0; 00083 } 00084 00085 00086 00087 00088 00089
Generated on Thu Jul 28 2022 19:49:46 by
