Day 1 - Programming Basics / Tag 1 - Grundlagen der Programmierung

in #development6 years ago

IMG_2446.jpg

On the first day Fundamentals of programming, we immediately realized how quickly our instructor got started. No wonder, we only have 29 days for the hard Tobak!

However, before we wrote the first line of code, we first had to understand the big picture. So what does a software life cycle describe and what are the phases of software development.

More important is knowing how to create or present a schedule of a planned program. This is to provide an overview of how the program should work.

The basic principle is always: input processing output.

Once you understand that, you're getting a lot better. So: think logically!

Example of a program schedule:
Bildschirmfoto 2018-01-08 um 13.44.34.png

So you can clearly see how a program works. After the start you enter the variables a and b. The values ​​are added and the variable c assigned. The value of the variable c is output and the program is finished.
So easy, so far.

The whole can also be displayed in a structogram or Nassi Shneiderman diagram. Basically exactly the same, but built table-like. But I do not want to go into that.

Much more important is the depiction of "pseudocode". Here is already working with some data types from the code to make it more concrete.
Bildschirmfoto 2018-01-08 um 14.07.53.png
The "int" stands for "integer" and is in the programming language C a variable whose value can be changed during the course of the program.

The aim of the pseudocode is that every programmer can create the program from it.

Everything clear so far?

Well, then let's go back to the variables mentioned. Variables of type int can only record integers that are allowed to be positive or negative. So like 5, 10, -1 or -200. However, no floating-point numbers such as 2.214 or letters.

There are other elementary data types:

Float (floating point numbers) e.g. 2214
Char (for the representation of a character) e.g. A, a, 1, 2.
Bool (to represent true or false)

But more on that later.

** Okay and what's up? **

Well, operators! Operators such as the "=" character are used to assign new values ​​to variables or to associate the values ​​of multiple variables, such as addition or subtraction.

There are different types of operators. The "=" is an assignment operator.

Arithmetic operators are:
Bildschirmfoto 2018-01-08 um 21.44.51.png

----------To be continued with day 2-------------

-----German-----

Am ersten Tag Grundlagen der Programmierung wurde uns sofort klar mit welcher Geschwindigkeit unsere Dozentin loslegt. Ist ja auch kein Wunder, haben wir ja nur 29 Tage für den harten Tobak!

Bevor wir allerdings die erste Zeile Code geschrieben haben, mussten wir erst einmal das große ganze verstehen. Also was beschreibt ein Softwarelebenszyklus und welche sind die Phasen der Softwareentwicklung.

Wichtiger aber noch, ist zu wissen wie man sich einen Ablaufplan eines geplanten Programms erstellt oder darstellt. Dies dient nämlich dazu, sich einen Überblick zu verschaffen wie das Programm funktionieren soll.
Das Grundprinzip ist immer: Eingabe- Verarbeitung- Ausgabe.

Hat man das verstanden gehts einem schon mal viel besser. Also: logisch denken!

Beispiel eines Programmablaufplans:Bildschirmfoto 2018-01-08 um 13.44.34.png

Man sieht also ganz deutlich, wie ein Programm arbeitet. Nach dem Start gibt man die Variablen a und b ein. Die Werte werden addiert und der Variablen c Zugewiesen. Der Wert der Variablen c wird ausgegeben und das Programm ist beendet.
Also ganz easy, bisher.

Das ganze lässt sich ebenso in einem Struktogramm oder auch Nassi Shneiderman Diagramm gennant, abbilden. Im Grunde genau gleich, jedoch Tabellenartiger aufgebaut. Darauf möchte ich aber nicht näher eingehen.

Wesentlich wichtiger ist hingegen die Darstellung eines “Pseudocodes“. Hier wird bereits mit einigen Datentypen aus dem Code gearbeitet um es zu konkretisieren.
Bildschirmfoto 2018-01-08 um 14.07.53.png

Das „int“ steht für „Integer“ und ist in der Programmiersprache C eine Variable dessen Wert man im laufe des Programmablaufs verändern kann.
Ziel des Pseudocodes ist es, das jeder Programmierer daraus das Programm erstellen kann.

Soweit alles klar?

Gut, dann kommen wir noch mal zu den genannten Variablen zurück. Variablen vom Typ int können nur Ganzzahlen die positiv oder negativ sein dürfen aufnehmen. Also wie 5, 10, -1 oder -200. Jedoch keine Gleitkommazahlen wie etwa 2.214 oder Buchstaben.

Es gibt noch weitere elementare Datentypen:

Float (Fließkommazahlen) z.B. 2.214
Char (für die Darstellung eines Zeichens) z.B. A, a, 1, 2.
Bool (zur Darstellung von Wahr oder Falsch)

Dazu aber zu einem späteren Zeitpunkt mehr.

Okay und was gibts noch?

Na, Operatoren! Operatoren wie das Zeichen „=„ werden genutzt um Variablen neue Werte zuzuweisen oder die Werte mehrerer Variablen miteinander zu verknüpfen wie durch Addition oder Subtraktion.

Es gibt verschiedene Typen von Operatoren. Das „=„ ist ein Zuwiesungsoperator.

Arithmetische Operatoren sind:
Bildschirmfoto 2018-01-08 um 21.44.51.png

-----Fortsetzung folgt mit Tag 2-------

Coin Marketplace

STEEM 0.27
TRX 0.13
JST 0.032
BTC 65852.33
ETH 2958.72
USDT 1.00
SBD 3.73