{"id":1872,"date":"2024-10-03T08:00:00","date_gmt":"2024-10-03T06:00:00","guid":{"rendered":"https:\/\/www.fuhselab.de\/?p=1872"},"modified":"2025-05-28T07:26:00","modified_gmt":"2025-05-28T05:26:00","slug":"coding-workshop-05","status":"publish","type":"post","link":"https:\/\/www.fuhselab.de\/index.php\/2024\/10\/03\/coding-workshop-05\/","title":{"rendered":"Coding Workshop 05"},"content":{"rendered":"\n<p><br>Die Grundrechenarten wurden im letzten Coding Workshop vorgestellt und nun geht es mit einigen anderen Variablen weiter\u2026<\/p>\n\n\n\n<!--more-->\n\n\n\n<p><br><strong>Das Alphabet mit C++:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\nint main()\n{\nfor(char i = 'A'; i &lt;= 'Z'; ++i)\n{std::cout &lt;&lt; i;\n}\n}<\/code><\/pre>\n\n\n\n<p><br><strong>Increment und Dekrement mit C++:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\nint main() \n{\nint a = 10;\nint c ;\n\nc = a++;   \nstd::cout &lt;&lt; \"Zeile 1 \u2013 Wert der Variable  a++ ist :\" &lt;&lt; c &lt;&lt; std::endl ;\nstd::cout &lt;&lt; \"Zeile 2 \u2013 Wert der Variable nach Increment ist :\" &lt;&lt; a &lt;&lt; std::endl ;\n\nc = ++a;  \nstd::cout &lt;&lt; \"Zeile 3 \u2013 Wert der Variable ++a ist:\" &lt;&lt; c &lt;&lt; \nstd::endl; \nreturn 0;\n}\n\n#include &lt;iostream&gt;\nint main()\n{\nint a = 10;\nint c ;\n\nc = ++a;   \nstd::cout &lt;&lt; \"Der Startwert der Variable  a ist :\" &lt;&lt; a &lt;&lt; \nstd::endl;\nstd::cout &lt;&lt; \"Der Wert der Variable nach Increment ist :\" &lt;&lt; c &lt;&lt; \nstd::endl;\nreturn 0;\n}<\/code><\/pre>\n\n\n\n<p><br><strong>Die Grundrechenarten in einem Code:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n\nint main(){\n\nint Ergebnis;                                       \/\/ Anlegen einer Variable\n\nErgebnis = ((3 + 3*4)\/5 - 1)*512 - 768;             \/\/ Ergebnis berechnen\n\nstd::cout &lt;&lt; \"((3 + 3*4)\/5 - 1)*512 - 768 = \"       \/\/ Aufgabe ausgeben\n&lt;&lt; Ergebnis                               \/\/ Ergebnis ausgeben\n&lt;&lt; std::endl;                             \/\/ Zeilenumbruch\n}<\/code><\/pre>\n\n\n\n<p><br><strong>Das erste kleine Taschenrechner-Programm:<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;iostream&gt;\n\nint main()\n{\nint Summand1, Summand2, Ergebnis;          \/\/ Anlegen von drei Variablen\n\nstd::cout &lt;&lt; \"Benutzereingabe f\u00fcr Addition Zahl1: \";\nstd::cout &lt;&lt; \"Benutzereingabe f\u00fcr Addition Zahl2: \";\n\nstd::cin &gt;&gt; Summand1 &gt;&gt; Summand2;          \/\/ Zwei Zahlen eingeben\n\nErgebnis = Summand1 + Summand2;            \/\/ Ergebnis berechnen\n\nstd::cout &lt;&lt; Summand1 &lt;&lt; \" + \" &lt;&lt; Summand2 \/\/ beide durch \" + \" getrennt wieder ausgeben\n\n&lt;&lt; \" = \"                         \/\/ \" = \" ausgeben\n&lt;&lt; Ergebnis                      \/\/ Ergebnis ausgeben\n&lt;&lt; std::endl;                    \/\/ Zeilenumbruch\n}<\/code><\/pre>\n\n\n\n<p><br>Im Terminal wird die erste Zahl eingegeben, dann wird die Return-Taste bet\u00e4tigt und anschlie\u00dfend kann die zweite Zahl eingegeben werden. Abschlie\u00dfend wird<br>auch die Rechnung durchgef\u00fchrt und das Ergebnis angezeigt.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Die Grundrechenarten wurden im letzten Coding Workshop vorgestellt und nun geht es mit einigen anderen Variablen weiter\u2026<\/p>\n","protected":false},"author":1,"featured_media":543,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33],"tags":[32],"class_list":["post-1872","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-coding-club","tag-coding-club-peine"],"_links":{"self":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1872","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/comments?post=1872"}],"version-history":[{"count":2,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1872\/revisions"}],"predecessor-version":[{"id":2849,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/posts\/1872\/revisions\/2849"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media\/543"}],"wp:attachment":[{"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/media?parent=1872"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/categories?post=1872"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.fuhselab.de\/index.php\/wp-json\/wp\/v2\/tags?post=1872"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}