You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
4.0 KiB
TeX

\documentclass[a4paper,fontsize=12pt,listof=totoc,toc=sectionentrywithdots,table,hyphens]{scrartcl}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{emoji}
\usepackage{polyglossia}
\setdefaultlanguage{german}
\usepackage{lmodern}
\usepackage[explicit]{titlesec} % for changing section titles
\titleformat{\section}[hang]{\Large\scshape}{}{0pt}{#1\hspace{0.3cm}\thesection}[] %
\titleformat{\subsection}[hang]{\Large\scshape}{}{0pt}{#1\hspace{0.3cm}\thesubsection}[] %
\titleformat{\paragraph}[hang]{\bfseries}{}{0pt}{#1\hspace{0.3cm}}[] %
\usepackage[onehalfspacing]{setspace}
\setcounter{secnumdepth}{5} % numbered paragraphs
\usepackage{fancyhdr}
\setlength{\headheight}{15.2pt}
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{Übung 1 2023}
\fancyhead[L]{OOP mit C++ $\vert$ Isabell Pflug}
\fancyfoot[C]{\thepage}
%
% math packages
%
\usepackage{mathtools}
\usepackage{amsxtra,amssymb,amsthm,amstext,amsfonts}
\usepackage{thmtools}
\usepackage{calrsfs} % for changing \mathcal to beauty
\usepackage{physics}
\usepackage{xpatch} % for fixing thmtools
%
% microtype setting
%
\usepackage{float} % better control of placements
%
% tables
%
\usepackage{booktabs} % optimised display of tables
\usepackage{tabularx} % more modern display of tables with \toprule,\midrule,\bottomrule
\usepackage{multirow} % allows table cells over multiple rows within a column
\usepackage{tablefootnote} % allows usage of footnotes in tables
%
% misc packages
%
\usepackage[atend]{bookmark}
\bookmarksetup{numbered}
\usepackage{xifthen} % for better fachbegriff environment
\usepackage{enumitem} % to change enumerate symbols
\setlist[enumerate,1]{label=\alph*)}
\usepackage{cprotect} % to be able to use verbatim in a caption
\usepackage[extendedchars]{grffile} % for spaces and special chars in file paths
\usepackage{xcolor} % adds colours
\usepackage{subcaption}
\usepackage{csquotes}
\usepackage{pdfpages}
\usepackage{multicol} % allows dividing (parts of) the page into multiple columns
\usepackage{url} % adds hyperlinks
\usepackage[]{hyperref} % adds links to toc
%
% define custom colors
%
\definecolor{bmpink}{HTML}{FF91AF}
\definecolor{mauve}{HTML}{BB85AB}
\definecolor{pastyel}{HTML}{FFFFCA}
\definecolor{grey}{HTML}{F2F2F2}
\definecolor{pastgreen}{HTML}{CCFFCC}
\definecolor{pastred}{HTML}{FFCCCC}
\definecolor{deepurple}{HTML}{730099}
\definecolor{mint}{HTML}{00e699}
%
% listings
%
\usepackage{listings}
%
% custom commands
%
\newcommand{\Autor}{Isabell Pflug} % your name here
\newcommand{\parabreak}{\phantom{angy} \\}
%
% math related custom commands
%
\renewcommand{\epsilon}{\varepsilon}
\renewcommand{\phi}{\varphi}
%
% theorems
%
\theoremstyle{definition}
\newtheorem{lemma}{Lemma}[section]
\renewcommand{\qed}{%
\ifmmode
\intertext{\hfill \emoji{feet} \nonumber}
\else
\hfill \emoji{feet}
\fi
}
\newcommand{\Aufgabe}{\section{Aufgabe}}
%
% make title
%
\title{OOP mit C++ \\
{\Large Aufgabenblatt 1}}
\author{\Autor}
\date{\today}
\begin{document}
\maketitle
\Aufgabe
\begin{table}[h!]
\centering
\begingroup
\setlength{\tabcolsep}{12pt}
\renewcommand{\arraystretch}{1.5}
\begin{tabular}{rlll}
\toprule
Zeile & Ausdruck & Wert & Typ \\
\midrule
\verb|1:| & \verb|int a = 5; int b = 2; double c = b;| \qquad \qquad \qquad & -- & -- \\
\verb|2:| & \verb|a * b - - - - - - 12.0f| & 22 & \verb|float| \tablefootnote{32-bit single precision floating-point, IEEE-754} \\
\verb|3:| & \verb|a / b / c| & 1 & \verb|double| \tablefootnote{64-bit double precision floating-point, IEEE-754} \\
\verb|4:| & \verb|a / c / b| & 1.25 & \verb|double| \\
\verb|5:| & \verb|-1.0f - a * 2E-1 + a / 2| & 0 & \verb|double| \\
\verb|6:| & \verb|1.0 + (a *= (2 / - b - (c += .0E2 )))| & -14 & \verb|double| \\
\bottomrule
\end{tabular}
\endgroup
\end{table}
\pagebreak
\Aufgabe
\lstinputlisting[language=C++, breaklines=true]{01_2.cpp}
\end{document}