Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Uwe Wienkop
Prog2-SS2020-Wienkop
Commits
bd6e3e9f
Commit
bd6e3e9f
authored
Jun 06, 2020
by
Uwe Wienkop
Browse files
2020-06-06 Sa
parent
88112a77
Changes
7
Hide whitespace changes
Inline
Side-by-side
.vs/prog2-ss2020-wienkop/v16/.suo
View file @
bd6e3e9f
No preview for this file type
01Indexer/Program.cs
View file @
bd6e3e9f
...
...
@@ -50,6 +50,9 @@ namespace _01Indexer
pm1
[
2
]
=
new
Person
(
"Claudia"
);
pm1
[
3
]
=
new
Person
(
"Dieter"
);
if
(
pm1
[
"Berta"
]!=
null
)
Console
.
WriteLine
(
"Berta ist im Feld vorhanden!"
);
#
region
Weitere
M
ö
glichkeiten
Person
[]
pers
=
pm1
[
"er"
];
foreach
(
Person
p
in
pers
)
...
...
07 UebgSaKeyValueList/Program.cs
View file @
bd6e3e9f
...
...
@@ -4,14 +4,34 @@ using System.Collections.Generic;
// Modifizieren/Erweitern Sie die KeyValue Klassen bzw. das Main()-Programm
// derart, dass Sie eine weitergehende Kalenderverwaltung realisieren. In
// Main erstellen Sie bitte eine Menü mit Auswahl:
// 1 - Termin eintragen (tt.mm|Thema|Projekt|Teilnehmer)
// 1 - Termin eintragen (tt.mm|Thema|Projekt|Teilnehmer
|Uhrzeit
)
// 2 - Monatstermine auflisten; Eingabe Monat mm
// 3 - Jahrestermine auflisten
// 4 - Alle Termine eines Projekts im Monat mm; Eingabe mm|Projektname
// Diskutieren Sie die KeyValue-Struktur
// 12 x 100 (5 Tage x 4 Wochen x 5 Termine/Tag); 10 Projekte
// Variante 1: Ebene 1: Monat; Ebene 2: Projekt; Value 2: Restliche Infos
// Variante 2: Ebene 1: Datum; Value 1: Restl. Infos
// 06 | {
// Prog2 | {
// 09, 8:45, Übung, Gruppe-B
// 09, 9:45, Vorlesung, alle
// }
// | {
// DigBB | { ...
// Ebene 1: 12 Elemente, 10 Elemente, 10 Einträge/Proj.
// Suchschritte: 6 + 5 + 5 = 16
// Variante 2: Ebene 1: Datum; Value 1: Restl. Infos
// 09-06 | {
// 08:00, Übung, Prog2, Gruppe-B
// 09:45, Vorlesung, Prog2, alle
// }
// 10-06 | {
// 09:45, Vorlesung, DigBB, alle
// }
// Ebene 1: 240 Arbeitstage, Ebene 2: 5 Elemente
// Suchschritte: 120 + 3 = 123
namespace
_07KeyValueList
{
...
...
@@ -56,6 +76,10 @@ namespace _07KeyValueList
KeyValueListe
<
string
,
List
<
Termin
>>
terminverwaltung
=
new
KeyValueListe
<
string
,
List
<
Termin
>>();
terminverwaltung
[
"03.06.2020"
]
=
termineMi
;
terminverwaltung
[
"02.06.2020"
]
=
termineDi
;
terminverwaltung
[
"02.06.2020"
].
Add
(
new
Termin
(
"11:30 Teams"
,
"BayernMINT"
));
KeyValueListe
<
string
,
KeyValueListe
<
char
,
string
>>
l3
=
new
KeyValueListe
<
string
,
KeyValueListe
<
char
,
string
>>();
l3
[
"Wienkop"
][
'A'
]
=
"Teambesprechung"
;
foreach
(
var
tag
in
terminverwaltung
)
{
...
...
07 UebgSaKeyValueList/liste.cs
View file @
bd6e3e9f
...
...
@@ -22,7 +22,7 @@ namespace _07KeyValueList
Element
anf
=
null
,
ende
=
null
;
int
anz
=
0
;
// Sehr sinnvoll für Index-Ops
//public StringListe() { }
p
ublic
void
AddEnd
(
K
key
,
V
val
)
p
rivate
void
AddEnd
(
K
key
,
V
val
)
{
Element
neuesElement
=
new
Element
(
key
,
val
);
// 1. Neues Element anlegen
anz
++;
...
...
07InterfaceStack/Program.cs
View file @
bd6e3e9f
...
...
@@ -66,18 +66,27 @@ namespace _06InterfaceStack
class
Program
{
static
void
Main
(
string
[]
args
)
{
IStack
<
string
>
stack
=
new
ArrayStack
<
string
>();
stack
.
Push
(
"Anton"
);
stack
.
Push
(
"Berta"
);
stack
.
Push
(
"Claudia"
);
//IStack<string> stack1 = new ArrayStack<string>();
IStack
<
string
>
stack1
=
new
ListStack
<
string
>();
//IStack<string> stack1 = new IStack<string>();
// Nicht zulässig, da IStack<> eine abstrakte Klasse ist!
stack1
.
Push
(
"Anton"
);
stack1
.
Push
(
"Berta"
);
stack1
.
Push
(
"Claudia"
);
while
(
stack
.
Count
>
0
)
Console
.
WriteLine
(
stack
.
Pop
());
while
(
stack
1
.
Count
>
0
)
Console
.
WriteLine
(
stack
1
.
Pop
());
}
}
}
07KeyValueList/liste.cs
View file @
bd6e3e9f
...
...
@@ -22,7 +22,7 @@ namespace _07KeyValueList
Element
anf
=
null
,
ende
=
null
;
int
anz
=
0
;
// Sehr sinnvoll für Index-Ops
//public StringListe() { }
p
ublic
void
AddEnd
(
K
key
,
V
val
)
p
rivate
void
AddEnd
(
K
key
,
V
val
)
{
Element
neuesElement
=
new
Element
(
key
,
val
);
// 1. Neues Element anlegen
anz
++;
...
...
07NichtNachmachen/Program.cs
View file @
bd6e3e9f
...
...
@@ -14,10 +14,11 @@ namespace _06NichtNachmachen
// BITTE SO REALISIEREN:
class
Motorrad
{
Rad
a
,
b
;
Rad
a
,
b
;
// ~ ein Motorrad *HAT* / *BESITZT* zwei Räder
public
void
xxx
()
{
a
.
durchmesser
=
55
;
b
.
durchmesser
=
55
;
}
}
...
...
@@ -26,7 +27,7 @@ namespace _06NichtNachmachen
// !!! NICHT NACHMACHEN !!!
// Bitte bei
Vererb
ung zwischen hat-ein und ist-ein Relation unterscheiden
// Bitte bei
Klassenbezieh
ung
en
zwischen hat-ein und ist-ein Relation unterscheiden
// Vererbung: ist-ein Relation => Motorrad ist-ein(e Spezialisierung) eines Rads
// Besitzt: hat-ein Relation => Motorrad hat- zwei Räder
class
MotorradVererbt
:
Rad
...
...
@@ -38,6 +39,8 @@ namespace _06NichtNachmachen
durchmesser
=
55
;
}
}
class
Program
{
static
void
Main
(
string
[]
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment