Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hp
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Daniel
hp
Commits
bc2564af
Commit
bc2564af
authored
Oct 8, 2017
by
Peter Gerwinski
Browse files
Options
Downloads
Patches
Plain Diff
2. Update Übungsaufgaben 9.10.2017
parent
7728eeec
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
20171009/hp-uebung-20171009.pdf
+0
-0
0 additions, 0 deletions
20171009/hp-uebung-20171009.pdf
20171009/hp-uebung-20171009.tex
+26
-19
26 additions, 19 deletions
20171009/hp-uebung-20171009.tex
common/pgscript.sty
+1
-1
1 addition, 1 deletion
common/pgscript.sty
with
27 additions
and
20 deletions
20171009/hp-uebung-20171009.pdf
+
0
−
0
View file @
bc2564af
No preview for this file type
This diff is collapsed.
Click to expand it.
20171009/hp-uebung-20171009.tex
+
26
−
19
View file @
bc2564af
% hp-uebung-201
6
10
1
0.pdf - Exercises on Low-Level Programming / Applied Computer Sciences
% hp-uebung-201
7
100
9
.pdf - Exercises on Low-Level Programming / Applied Computer Sciences
% Copyright (C) 2013, 2015, 2016 Peter Gerwinski
% Copyright (C) 2013, 2015, 2016
, 2017
Peter Gerwinski
%
%
% This document is free software: you can redistribute it and/or
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% modify it either under the terms of the Creative Commons
...
@@ -31,12 +31,15 @@
...
@@ -31,12 +31,15 @@
\thispagestyle
{
empty
}
\thispagestyle
{
empty
}
\section*
{
Hardwarenahe Programmierung / Angewandte Informatik
\\
\section*
{
Hardwarenahe Programmierung / Angewandte Informatik
\\
Übungsaufgaben --
10
.
\
Oktober 201
6
}
Übungsaufgaben --
9
.
\
Oktober 201
7
}
\exercise
{
Hello, world!
}
\exercise
{
Hello, world!
}
Unter
\url
{
https://gitlab.cvh-server.de/pgerwinski/hp/tree/master/20171009
}
Unter
\url
{
https://gitlab.cvh-server.de/pgerwinski/hp/tree/master/20171009
}
finden Sie eine Auswahl an Beispielprogrammen:
können Sie
\href
{
https://gitlab.cvh-server.de/pgerwinski/hp/raw/master/20171009/hp-uebung-20171009.pdf
}
%
{
diesen Übungszettel als PDF-Datei
}
herunterladen sowie die folgenden Beispielprogramme:
\begin{enumerate}
[
\quad
(a)]
\begin{enumerate}
[
\quad
(a)]
\item
\gitfile
{
hp
}{
20171009
}{
hello.c
}
\item
\gitfile
{
hp
}{
20171009
}{
hello.c
}
\item
\gitfile
{
hp
}{
20171009
}{
hello-opengl.c
}
\item
\gitfile
{
hp
}{
20171009
}{
hello-opengl.c
}
...
@@ -46,21 +49,25 @@
...
@@ -46,21 +49,25 @@
und/oder auf einem Rechner der Hochschule
und/oder auf einem Rechner der Hochschule
unter einem Betriebssystem Ihrer Wahl zum Laufen.
unter einem Betriebssystem Ihrer Wahl zum Laufen.
\file
{
hello.c
}
ist das klassische "`Hello, world!"'-Programm
.
\file
{
hello.c
}
ist das klassische "`Hello, world!"'-Programm
,
\file
{
hello-gtk
}
erzeugt ein Fenster mit einem Button zum Schließen,
\file
{
hello-gtk
}
erzeugt ein Fenster mit einem Button zum Schließen,
\file
{
hello-opengl
}
erzeugt ein Fenster, das nach 5 Sekunden
und
\file
{
hello-opengl
}
erzeugt ein Fenster, das nach 5 Sekunden
von selbst wieder verschwindet.
von selbst wieder verschwindet.
(Wie diese Programme im einzelnen funktionieren,
wird im Laufe der Lehrveranstaltung erklärt werden.
In dieser Übung geht es nur darum,
sich mit dem Compilieren von C-Programmen vertraut zu machen.)
\textbf
{
Hinweis 0:
}
Diese PDF-Datei enthält Links zu den jeweiligen Dateien.
\textbf
{
Hinweis 0:
}
Diese PDF-Datei enthält Links zu den jeweiligen Dateien.
Durch Anklicken können Sie diese direkt herunterladen.
Durch Anklicken können Sie diese direkt herunterladen.
\textbf
{
Hinweis 1:
}
Für (b) und (c) benötigen Sie die Bibliotheken
\textbf
{
Hinweis 1:
}
Für (b) und (c) benötigen Sie die Bibliotheken
GTK+
sowie
OpenGL einschließlich GLUT oder FreeGLUT.
GTK+
bzw.
\
OpenGL einschließlich GLUT oder FreeGLUT.
Diese finden Sie -- einschließlich Dokumentation --
Diese finden Sie -- einschließlich Dokumentation --
als freie Software im Internet.
als freie Software im Internet.
\textbf
{
Hinweis 2:
}
Unter Unix mit
\lstinline
[style=cmd]
{
gcc
}
\textbf
{
Hinweis 2:
}
Unter Unix mit
\lstinline
[style=cmd]
{
gcc
}
geh
t das Compilieren und Starten der Programme folgendermaßen:
funktionier
t das Compilieren und Starten der Programme folgendermaßen:
\begin{lstlisting}
[style=cmd]
\begin{lstlisting}
[style=cmd]
gcc -Wall -O hello.c -o hello
gcc -Wall -O hello.c -o hello
./hello
./hello
...
@@ -70,6 +77,17 @@
...
@@ -70,6 +77,17 @@
.
/
hello
-
gtk
.
/
hello
-
gtk
\end
{
lstlisting
}
\end
{
lstlisting
}
\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
}
\exercise
{
Multiplikationstabelle
}
Geben Sie mit Hilfe einer Schleife ein "`Einmaleins"' aus.
\\
Geben Sie mit Hilfe einer Schleife ein "`Einmaleins"' aus.
\\
...
@@ -84,15 +102,4 @@
...
@@ -84,15 +102,4 @@
(
siehe dazu die Dokumentation zu
\lstinline
{
printf
()
}
,
(
siehe dazu die Dokumentation zu
\lstinline
{
printf
()
}
,
z.
\,
B.
\ \,\lstinline
[
style
=
cmd
]
{
man
3
printf
}
\,
)
z.
\,
B.
\ \,\lstinline
[
style
=
cmd
]
{
man
3
printf
}
\,
)
\exercise
{
Schaltjahr ermitteln
}
Schreiben Sie ein 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
}
\end
{
document
}
\end
{
document
}
This diff is collapsed.
Click to expand it.
common/pgscript.sty
+
1
−
1
View file @
bc2564af
% pgscript.sty - LaTeX Settings for Lecture Notes
% pgscript.sty - LaTeX Settings for Lecture Notes
% Copyright (C) 2012, 2015 Peter Gerwinski
% Copyright (C) 2012, 2015
, 2017
Peter Gerwinski
%
%
% This document is free software: you can redistribute it and/or
% This document is free software: you can redistribute it and/or
% modify it either under the terms of the Creative Commons
% modify it either under the terms of the Creative Commons
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment