WUT_Computer_Science/NotProgramming/ESOEN/HW2/HW2.tex

80 lines
4.2 KiB
TeX
Raw Permalink Normal View History

2022-11-05 14:03:13 +01:00
\documentclass[12pt]{article}
2022-11-06 18:02:27 +01:00
\usepackage{graphicx}
2022-11-06 22:05:00 +01:00
\title{ESOEN Tutorial 2 HW}
\author{Krzysztof Rudnicki, 307585}
2022-11-05 14:03:13 +01:00
\begin{document}
2022-11-06 22:05:00 +01:00
\maketitle
2022-11-05 14:03:13 +01:00
\section{Task 1}
\subsection{Task A}
2022-11-06 18:02:27 +01:00
Prepare a use case diagram for the following description: \\
"A student can check a timetable of the lessons and its own results in the university system. To use these services the student needs to authorize in the system. The student can add its comment to the timetable, if necessary."
\\
2022-11-06 22:05:00 +01:00
\includegraphics[width=\textwidth]{1A.pdf}
2022-11-05 14:03:13 +01:00
\subsection{Task B}
2022-11-06 18:02:27 +01:00
Propose different ways of modelling of a student authorization (different diagrams). \\
2022-11-06 22:05:00 +01:00
\includegraphics[width=\textwidth]{1B.pdf}
2022-11-06 18:02:27 +01:00
2022-11-05 14:03:13 +01:00
2022-11-06 18:02:27 +01:00
\newpage
2022-11-05 14:03:13 +01:00
\section{Task 2}
Categorize the following relationships into \textbf{generalization}, \textbf{aggregation}, or \textbf{association}. Draw an appropriate \textbf{class diagram}. There could be more than one solution if applicable.
\subsection{A dining philosopher is using a fork.}
Dining philosopher is using \textbf{exactly} one fork and one fork is used \textbf{exactly} by one philosopher. \\
This is \textbf{association}, this is not aggregation as fork is not a part of philosopher, neither philosopher part of fork, and this is not generalization as philosopher is not a kind of fork and fork is not a kind of philosopher.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{31.pdf}
2022-11-05 14:03:13 +01:00
\subsection{A file is an ordinary file or a directory file. }
2022-11-06 18:02:27 +01:00
This is \textbf{generalization}, ordinary file is a kind of file, also directory is a kind of file, this is not aggregation as ordinary/directory file is not part of file.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{32.pdf}
2022-11-05 14:03:13 +01:00
\subsection{Files contain records.}
2022-11-06 18:02:27 +01:00
This is \textbf{aggregation}, records are part of files, this is not generalization as records are not kind of file.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{33.pdf}
2022-11-06 18:02:27 +01:00
2022-11-05 14:03:13 +01:00
\subsection{A polygon is composed of an ordered set of points. }
2022-11-06 18:02:27 +01:00
This is \textbf{aggregation}, points are part of polygon, this is not generalization as points are not kind of polygon.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{34.pdf}
2022-11-05 14:03:13 +01:00
\subsection{A person uses a computer language on a project. }
2022-11-06 18:02:27 +01:00
This is \textbf{association}, this is not aggregation as computer language is not a part of person, neither person part of computer language, and this is not generalization as person is not a kind of computer language and computer language is not a kind of person.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{35.pdf}
2022-11-05 14:03:13 +01:00
\subsection{A route connects two cities }
2022-11-06 18:02:27 +01:00
This is \textbf{association}, cities are associated through route.
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{36.pdf}
2022-11-05 14:03:13 +01:00
2022-11-06 22:05:00 +01:00
\newpage
2022-11-05 14:03:13 +01:00
\subsection{Modems and keyboards are input/output devices. }
2022-11-06 18:02:27 +01:00
This is \textbf{generalization}, Modems and keyboards are kind of input/output devices, this is not aggregation as modems/keyboards are not part of input/output devices
2022-11-06 22:05:00 +01:00
\\ \includegraphics[width=\textwidth]{37.pdf}
2022-11-06 18:02:27 +01:00
\section{Task 3}
Are the following sentences consistent with the given class diagram (Explain)?
\\
\includegraphics[width=\textwidth]{Class1_103.png}
\paragraph{“Johns car has 10 wheels, including the spares.” }
It is \textbf{not consistent} as there is maximum of \textbf{8} wheels on a car.
\paragraph{“Each car has at least one wheel.” }
It is \textbf{consistent} and true always, as each car has minimum of \textbf{3} wheels on a car
\paragraph{“In my car, there are two wheels on the left side and two wheels on the right side” }
2022-11-06 22:05:00 +01:00
It is \textbf{consistent}, this particular car contains wheels in amount between minimum and maximum, we do not care about the position of those wheels in our class diagram. \newpage
2022-11-06 18:02:27 +01:00
2022-11-06 22:05:00 +01:00
Draw an exemplary object diagram for the class diagram. \\
\includegraphics[width=\textwidth]{4.pdf}
\newpage
2022-11-06 18:02:27 +01:00
\section{Task 4}
Prepare a class diagram based on the following description of a card-playing program.
\\
“Deck, hand, discard pile, and draw pile are collection of cards. The initial size of the hand depends on the type of game. The collection of cards consists of an ordered set of cards. A card can be displayed and discarded. Each card is characterized by its suit and rank. At the beginning of the game the collection of cards is initialized. The cards on the deck can be shuffled.”
\\
2022-11-06 22:05:00 +01:00
\includegraphics[width=\textwidth]{5.pdf}
2022-11-06 18:02:27 +01:00
2022-11-05 14:03:13 +01:00
\end{document}