Fix opdracht 1 en 2

Co-authored-by: Aryan Lala (19097727) <A.E.Lala@student.hhs.nl>
This commit is contained in:
Shaquille Soekhlal 2023-05-11 10:40:01 +02:00
parent 83e46713e1
commit 0ae21fa8ab
5 changed files with 85 additions and 12 deletions

23
.vscode/settings.json vendored
View File

@ -36,6 +36,27 @@
"xstddef": "cpp", "xstddef": "cpp",
"xstring": "cpp", "xstring": "cpp",
"xtr1common": "cpp", "xtr1common": "cpp",
"xutility": "cpp" "xutility": "cpp",
"array": "cpp",
"atomic": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"cctype": "cpp",
"clocale": "cpp",
"compare": "cpp",
"concepts": "cpp",
"cstdarg": "cpp",
"cwctype": "cpp",
"deque": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"vector": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"random": "cpp",
"string_view": "cpp",
"numbers": "cpp"
} }
} }

View File

@ -1,8 +1,8 @@
#include "Interface.h"
#ifndef Positie_H #ifndef Positie_H
#define Positie_H #define Positie_H
#include "Interface.h"
class Positie : public Interface{ class Positie : public Interface{
private: private:
int X; int X;

View File

@ -1,15 +1,15 @@
class Positie;
class Interface;
#ifndef Robot_H #ifndef Robot_H
#define Robot_H #define Robot_H
class Positie;
class Interface;
class Robot{ class Robot{
private: private:
Interface *P; Interface *P;
public: public:
Robot (Interface*); Robot (Interface*);
~Robot(); virtual ~Robot();
virtual void run(); virtual void run();
virtual void show(); virtual void show();
}; };

View File

@ -1,17 +1,17 @@
<mxfile host="65bd71144e"> <mxfile host="65bd71144e">
<diagram id="hUXen1-xG9g13vyYE9lk" name="Page-1"> <diagram id="hUXen1-xG9g13vyYE9lk" name="Page-1">
<mxGraphModel dx="838" dy="517" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0"> <mxGraphModel dx="802" dy="404" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="0">
<root> <root>
<mxCell id="0"/> <mxCell id="0"/>
<mxCell id="1" parent="0"/> <mxCell id="1" parent="0"/>
<mxCell id="5" value="Positie" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxCell id="5" value="Positie" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="170" y="320" width="140" height="150" as="geometry"/> <mxGeometry x="170" y="320" width="140" height="140" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="6" value="- x : Int&lt;br&gt;- y : int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="5" vertex="1"> <mxCell id="6" value="- x : Int&lt;br&gt;- y : int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="5" vertex="1">
<mxGeometry y="30" width="140" height="30" as="geometry"/> <mxGeometry y="30" width="140" height="30" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="7" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="5" vertex="1"> <mxCell id="7" value="+ move (int, int)&lt;br&gt;+ x : int&lt;br&gt;+ y : int" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="5" vertex="1">
<mxGeometry y="60" width="140" height="90" as="geometry"/> <mxGeometry y="60" width="140" height="80" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="9" value="Interface" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxCell id="9" value="Interface" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="170" y="90" width="140" height="110" as="geometry"/> <mxGeometry x="170" y="90" width="140" height="110" as="geometry"/>
@ -28,6 +28,15 @@
<mxCell id="16" value="Robot" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1"> <mxCell id="16" value="Robot" style="swimlane;fontStyle=0;childLayout=stackLayout;horizontal=1;startSize=30;horizontalStack=0;resizeParent=1;resizeParentMax=0;resizeLast=0;collapsible=1;marginBottom=0;whiteSpace=wrap;html=1;" parent="1" vertex="1">
<mxGeometry x="480" y="120" width="140" height="80" as="geometry"/> <mxGeometry x="480" y="120" width="140" height="80" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="23" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;strokeColor=default;" edge="1" parent="16">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="250" y="50" as="sourcePoint"/>
<mxPoint x="50" y="50" as="targetPoint"/>
<Array as="points">
<mxPoint x="70.24000000000001" y="50"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="17" value="+ show&lt;br&gt;+ run" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="16" vertex="1"> <mxCell id="17" value="+ show&lt;br&gt;+ run" style="text;strokeColor=none;fillColor=none;align=left;verticalAlign=middle;spacingLeft=4;spacingRight=4;overflow=hidden;points=[[0,0.5],[1,0.5]];portConstraint=eastwest;rotatable=0;whiteSpace=wrap;html=1;" parent="16" vertex="1">
<mxGeometry y="30" width="140" height="50" as="geometry"/> <mxGeometry y="30" width="140" height="50" as="geometry"/>
</mxCell> </mxCell>
@ -37,12 +46,54 @@
<mxPoint x="425" y="120" as="targetPoint"/> <mxPoint x="425" y="120" as="targetPoint"/>
</mxGeometry> </mxGeometry>
</mxCell> </mxCell>
<mxCell id="21" value="1" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1"> <mxCell id="21" value="1" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="435" y="125" width="30" height="30" as="geometry"/> <mxGeometry x="435" y="125" width="30" height="30" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="22" value="P" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1"> <mxCell id="22" value="P" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" parent="1" vertex="1">
<mxGeometry x="320" y="125" width="30" height="30" as="geometry"/> <mxGeometry x="320" y="125" width="30" height="30" as="geometry"/>
</mxCell> </mxCell>
<mxCell id="24" value="X=X+dx&lt;br&gt;Y=Y+dy" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="367" y="380" width="70" height="40" as="geometry"/>
</mxCell>
<mxCell id="25" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;strokeColor=default;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="270" y="410" as="sourcePoint"/>
<mxPoint x="378" y="410" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="26" value="std::cout &amp;lt;&amp;lt; P-&amp;gt;x() &amp;lt;&amp;lt; P-&amp;gt;y();" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="720" y="155" width="180" height="30" as="geometry"/>
</mxCell>
<mxCell id="27" value="return x" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="372" y="420" width="60" height="30" as="geometry"/>
</mxCell>
<mxCell id="28" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;strokeColor=default;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="270" y="435" as="sourcePoint"/>
<mxPoint x="378" y="435" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="30" value="return Y" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="367" y="430" width="70" height="30" as="geometry"/>
</mxCell>
<mxCell id="31" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;strokeColor=default;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="270" y="445" as="sourcePoint"/>
<mxPoint x="378" y="445" as="targetPoint"/>
</mxGeometry>
</mxCell>
<mxCell id="36" value="" style="endArrow=none;dashed=1;html=1;dashPattern=1 3;strokeWidth=2;strokeColor=default;" edge="1" parent="1">
<mxGeometry width="50" height="50" relative="1" as="geometry">
<mxPoint x="690" y="185" as="sourcePoint"/>
<mxPoint x="517" y="185" as="targetPoint"/>
<Array as="points">
<mxPoint x="537.24" y="185"/>
</Array>
</mxGeometry>
</mxCell>
<mxCell id="37" value="P-&amp;gt;move(x, y);" style="text;html=1;align=center;verticalAlign=middle;resizable=0;points=[];autosize=1;strokeColor=none;fillColor=none;" vertex="1" parent="1">
<mxGeometry x="690" y="170" width="100" height="30" as="geometry"/>
</mxCell>
</root> </root>
</mxGraphModel> </mxGraphModel>
</diagram> </diagram>

View File

@ -10,6 +10,7 @@ class Auto{
Snelheid* S; Snelheid* S;
public: public:
Auto(Snelheid*); Auto(Snelheid*);
virtual ~Auto();
virtual void meetSnelheid(); virtual void meetSnelheid();
}; };