started working on assignment no. 1

main
Isabell Pflug 2 years ago
parent e1855b9fa1
commit a214109e88

@ -0,0 +1,18 @@
#include <stdio.h>
#include <iostream>
#include <typeinfo>
int aufgabe_1() {
int i = 1;
int a = 5; int b = 2; double c = b;
auto z1 = a * b - - - - - - 12.0f;
std::cout << "type of " << i << ": \t" << typeid(z1).name() << std::endl;
std::cout << "value of " << i << ": \t" << z1 << std::endl;
return 0;
}
int main() {
std::cout << "Hallo Welt" << std::endl;
aufgabe_1();
return 0;
}

@ -0,0 +1,6 @@
cmake_minimum_required(VERSION 3.11.4)
project (01)
file(GLOB SOURCES "*.cpp")
add_executable(01_1 ${SOURCES})

@ -0,0 +1,151 @@
\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{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
%
% 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}{rlcc}
\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| & & \\
\verb|3:| & \verb|a / b / c| & & \\
\verb|4:| & \verb|a / c / b| & & \\
\verb|5:| & \verb|-1.0f - a * 2E-1 + a / 2| & & \\
\verb|6:| & \verb|1.0 + (a *= (2 / - b - (c += .0E2 )))| & & \\
\bottomrule
\end{tabular}
\endgroup
\end{table}
\end{document}
Loading…
Cancel
Save