Skip to content
Snippets Groups Projects
Commit 3c562ad8 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Vorbereitung 17.10.2019

parent 765dc0b6
No related branches found
No related tags found
No related merge requests found
#include <stdio.h>
int main (void)
{
for (int i = 10; i = 0; i - 1)
printf ("%d\n", i);
return 0;
}
20191017/gitlab.png

589 B

File added
\documentclass{article}
\input tmp.inputs
\pagestyle{empty}
\begin{document}
\psscalebox{0.8}{%
\begin{pspicture}(-5,0)(12,12)
\small
\psset{unit=0.5cm}
\psline[arrows=<->](-1,0)(-1,22)
\rput(-1.3,0){\makebox(0,0)[br]{\textbf{gegenständlich}}}
\rput(-1.3,22){\makebox(0,0)[tr]{\textbf{abstrakt}}}
\rput(-1.3,2){\makebox(0,0)[r]{Elektromagnetismus, Halbleiter}}
\rput(-1.3,4){\makebox(0,0)[r]{Elektronische Bauelemente}}
\rput(-1.3,6){\makebox(0,0)[r]{Logik-Schaltkreise}}
\rput(-1.3,8){\makebox(0,0)[r]{Prozessoren}}
\rput(-1.3,9){\makebox(0,0)[r]{Maschinensprache}}
\rput(-1.3,10){\makebox(0,0)[r]{Assembler}}
\rput(-1.3,11){\makebox(0,0)[r]{Ein-/Ausgabe}}
\rput(-1.3,12.35){\makebox(0,0)[r]{\textbf{hardwarenahe Programmierung} (z.\,B.\ in C)}}
\rput(-1.3,14){\makebox(0,0)[r]{\shortstack[r]{abstrahierende Programmierung\\(z.\,B.\ in C++, Java)}}}
% \rput(-1.3,15){\makebox(0,0)[r]{Programmierung}}
\rput(-1.3,16){\makebox(0,0)[r]{Algorithmen, Datenstrukturen, Software-Entwurf}}
\rput(-1.3,17){\makebox(0,0)[r]{Requirements Engineering}}
\rput(-1.3,18){\makebox(0,0)[r]{formale Sprachen, Berechenbarkeit}}
\rput(-1.3,19){\makebox(0,0)[r]{mathematische Strukturen}}
\rput(-1.3,20){\makebox(0,0)[r]{mathematische Beweise}}
\rput(2.1,0.5){\makebox(0,0)[l]{Physik}}
\rput(4.1,4){\makebox(0,0)[l]{Elektrotechnik}}
\rput(6.1,8){\makebox(0,0)[l]{Rechnertechnik}}
\rput(8.1,12.35){\makebox(0,0)[l]{angewandte Informatik}}
\rput(10.1,16){\makebox(0,0)[l]{\shortstack[l]{Softwaretechnik und\\theoretische Informatik}}}
\rput(12.1,21){\makebox(0,0)[l]{Mathematik}}
\psset{linewidth=0.001,linestyle=none,fillstyle=gradient,gradmidpoint=1.0,gradlines=1000}
\definecolor{RGBwhite}{rgb}{1.0,1.0,1.0}
\definecolor{RGBblue}{rgb}{0.0,0.0,1.0}
\definecolor{RGBred}{rgb}{1.0,0.0,0.0}
\definecolor{RGBgreen}{rgb}{0.0,1.0,0.0}
\definecolor{RGByellow}{rgb}{1.0,1.0,0.0}
\definecolor{RGBorange}{rgb}{1.0,0.7,0.0}
\definecolor{RGBgrey}{rgb}{0.7,0.7,0.7}
\rput(0,2){\psframe[gradbegin=RGBwhite,gradend=RGBblue](2,2)}
\rput(0,0){\psframe[fillstyle=solid,fillcolor=RGBblue](2,2.01)}
\rput(2,6){\psframe[gradbegin=RGBwhite,gradend=RGBred](2,2)}
\rput(2,2){\psframe[gradbegin=RGBred,gradend=RGBwhite](2,2)}
\rput(2,3.99){\psframe[fillstyle=solid,fillcolor=RGBred](2,2.02)}
\rput(4,10){\psframe[gradbegin=RGBwhite,gradend=RGBgreen](2,2)}
\rput(4,6){\psframe[gradbegin=RGBgreen,gradend=RGBwhite](2,2)}
\rput(4,7.99){\psframe[fillstyle=solid,fillcolor=RGBgreen](2,2.02)}
\rput(6,14){\psframe[gradbegin=RGBwhite,gradend=RGByellow](2,2)}
\rput(6,10){\psframe[gradbegin=RGByellow,gradend=RGBwhite](2,2)}
\rput(6,11.99){\psframe[fillstyle=solid,fillcolor=RGByellow](2,2.02)}
\rput(8,18){\psframe[gradbegin=RGBwhite,gradend=RGBorange](2,2)}
\rput(8,14){\psframe[gradbegin=RGBorange,gradend=RGBwhite](2,2)}
\rput(8,15.99){\psframe[fillstyle=solid,fillcolor=RGBorange](2,2.02)}
\rput(10,18){\psframe[gradbegin=RGBgrey,gradend=RGBwhite](2,2)}
\rput(10,19.99){\psframe[fillstyle=solid,fillcolor=RGBgrey](2,2.01)}
\end{pspicture}
}
\end{document}
File added
This diff is collapsed.
File added
% hp-uebung-20191017.pdf - Exercises on Low-Level Programming / Applied Computer Sciences
% Copyright (C) 2013, 2015, 2016, 2017, 2018, 2019 Peter Gerwinski
%
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% Attribution-ShareAlike 3.0 License, or under the terms of the
% GNU General Public License as published by the Free Software
% Foundation, either version 3 of the License, or (at your option)
% any later version.
%
% This document is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this document. If not, see <http://www.gnu.org/licenses/>.
%
% You should have received a copy of the Creative Commons
% Attribution-ShareAlike 3.0 Unported License along with this
% document. If not, see <http://creativecommons.org/licenses/>.
% README: Schaltjahr ermitteln, Multiplikationstabelle, Fibonacci-Zahlen, fehlerhaftes Programm
\documentclass[a4paper]{article}
\usepackage{pgscript}
\thispagestyle{empty}
\begin{document}
\thispagestyle{empty}
\section*{Hardwarenahe Programmierung\\
Übungsaufgaben -- 17.\ Oktober 2019}
\exercise{Schaltjahr ermitteln}
Schreiben Sie ein C-Programm, das eine Jahreszahl erfragt
und ausgibt, ob es sich um ein Schaltjahr handelt.
\begin{itemize}
\item Wenn die Jahreszahl durch 4 teilbar ist, ist das Jahr zunächst einmal ein Schaltjahr.
\item Ausnahme: Wenn die Jahreszahl durch 100 teilbar ist, ist das Jahr kein Schaltjahr.
\item Ausnahme von der Ausnahme: Wenn die Jahreszahl durch 400 teilbar ist,\\
ist das Jahr doch wieder ein Schaltjahr.
\end{itemize}
\exercise{Multiplikationstabelle}
Geben Sie mit Hilfe einer Schleife ein "`Einmaleins"' aus.\\
Dabei sollen die Faktoren und Ergebnisse rechtsbündig untereinander stehen:
\begin{lstlisting}[style=terminal]
1 * 7 = 7
2 * 7 = 14
...
10 * 7 = 70
\end{lstlisting}
\textbf{Hinweis:} Verwenden Sie Formatspezifikationen wie z.\,B.\ \lstinline{%3d}\\
(siehe dazu die Dokumentation zu \lstinline{printf()},
z.\,B.\ \,\lstinline[style=cmd]{man 3 printf}\,)
\exercise{Fibonacci-Zahlen}
Die Folge der Fibonacci-Zahlen ist definiert durch:
\begin{quote}
1.\ Zahl: 0\\
2.\ Zahl: 1\\
nächste Zahl = Summe der beiden vorherigen
\end{quote}
Schreiben Sie ein Programm, das die ersten 50 Fibonacci-Zahlen ausgibt.
Falls Ihnen dabei irgendwelche Besonderheiten auffallen
und/oder Sie irgendwelche besondere Maßnahmen treffen,
dokumentieren Sie diese.
(Wem dies zu einfach ist, kann auch gerne
die ersten 100 Fibonacci-Zahlen ausgeben.)
\exercise{Fehlerhaftes Programm}
\begin{minipage}[t]{0.65\textwidth}
Wir betrachten das nebenstehende C-Programm
(Datei: \gitfile{hp}{20191017}{aufgabe-4.c}).
\begin{itemize}
\item[(a)]
Was bewirkt dieses Programm? Begründen Sie Ihre Antwort.
Schreiben Sie Ihre Begründung so auf,
daß man sie auch dann versteht,
wenn man gerade nicht die Möglichkeit hat,
bei Ihnen persönlich nachzufragen
(z.\,B.\ weil man gerade eine Klausur korrigiert).
Die Schwierigkeit dieser Aufgabe besteht
nicht allein darin, die Problematik zu verstehen,
sondern auch darin, dieses Verständnis für andere aufzuschreiben.
\item[(b)]
Ändern Sie das Programm so um,
daß es einen "`Countdown"' von 10 bis 0 ausgibt.
\end{itemize}
\end{minipage}\hfill
\begin{minipage}[t]{0.3\textwidth}
\begin{lstlisting}[gobble=6]
#include <stdio.h>
int main (void)
{
for (int i = 10; i = 0; i - 1)
printf ("%d\n", i);
return 0;
}
\end{lstlisting}
\end{minipage}
\end{document}
../common/logo-hochschule-bochum-cvh-text-v2.pdf
\ No newline at end of file
../common/logo-hochschule-bochum.pdf
\ No newline at end of file
../common/pgscript.sty
\ No newline at end of file
../common/pgslides.sty
\ No newline at end of file
#include <stdio.h>
int main (void)
{
int a = printf ("Hello, world!\n");
printf ("%d\n", a);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment