Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Uwe Wienkop
Prog1_WS2018_19_Wienkop
Commits
3364e8ab
Commit
3364e8ab
authored
Oct 16, 2018
by
Uwe Wienkop
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Dienstag, Übung 1
parent
1e1fddb3
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
268 additions
and
15 deletions
+268
-15
01Pythagoras/Prog1_WS2018.sln
01Pythagoras/Prog1_WS2018.sln
+12
-0
02Ausgabeaufbereitungen/02Ausgabeaufbereitungen.csproj
02Ausgabeaufbereitungen/02Ausgabeaufbereitungen.csproj
+53
-0
02Ausgabeaufbereitungen/App.config
02Ausgabeaufbereitungen/App.config
+6
-0
02Ausgabeaufbereitungen/Program.cs
02Ausgabeaufbereitungen/Program.cs
+24
-0
02Ausgabeaufbereitungen/Properties/AssemblyInfo.cs
02Ausgabeaufbereitungen/Properties/AssemblyInfo.cs
+36
-0
02Datentypen02/02Datentypen02/Program.cs
02Datentypen02/02Datentypen02/Program.cs
+1
-1
02Fallunterscheidungen2/02Fallunterscheidungen2.csproj
02Fallunterscheidungen2/02Fallunterscheidungen2.csproj
+53
-0
02Fallunterscheidungen2/App.config
02Fallunterscheidungen2/App.config
+6
-0
02Fallunterscheidungen2/Program.cs
02Fallunterscheidungen2/Program.cs
+25
-0
02Fallunterscheidungen2/Properties/AssemblyInfo.cs
02Fallunterscheidungen2/Properties/AssemblyInfo.cs
+36
-0
02Primzahltest1/02Primzahltest1/Program.cs
02Primzahltest1/02Primzahltest1/Program.cs
+16
-14
No files found.
01Pythagoras/Prog1_WS2018.sln
View file @
3364e8ab
...
...
@@ -15,6 +15,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Datentypen02", "..\02Date
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Primzahltest1", "..\02Primzahltest1\02Primzahltest1\02Primzahltest1.csproj", "{AB357D4E-E012-4C8D-9680-CD4CF5B972F4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Fallunterscheidungen2", "..\02Fallunterscheidungen2\02Fallunterscheidungen2.csproj", "{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "02Ausgabeaufbereitungen", "..\02Ausgabeaufbereitungen\02Ausgabeaufbereitungen.csproj", "{924685C3-2392-42EB-A850-1772F3942FE9}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
...
...
@@ -45,6 +49,14 @@ Global
{AB357D4E-E012-4C8D-9680-CD4CF5B972F4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{AB357D4E-E012-4C8D-9680-CD4CF5B972F4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{AB357D4E-E012-4C8D-9680-CD4CF5B972F4}.Release|Any CPU.Build.0 = Release|Any CPU
{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}.Release|Any CPU.Build.0 = Release|Any CPU
{924685C3-2392-42EB-A850-1772F3942FE9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{924685C3-2392-42EB-A850-1772F3942FE9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{924685C3-2392-42EB-A850-1772F3942FE9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{924685C3-2392-42EB-A850-1772F3942FE9}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
...
...
02Ausgabeaufbereitungen/02Ausgabeaufbereitungen.csproj
0 → 100644
View file @
3364e8ab
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{924685C3-2392-42EB-A850-1772F3942FE9}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_02Ausgabeaufbereitungen
</RootNamespace>
<AssemblyName>
02Ausgabeaufbereitungen
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<AutoGenerateBindingRedirects>
true
</AutoGenerateBindingRedirects>
<Deterministic>
true
</Deterministic>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release\
</OutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"System.Data.DataSetExtensions"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Net.Http"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
02Ausgabeaufbereitungen/App.config
0 → 100644
View file @
3364e8ab
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
02Ausgabeaufbereitungen/Program.cs
0 → 100644
View file @
3364e8ab
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_02Ausgabeaufbereitungen
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
double
a
=
1234.56789
;
Console
.
WriteLine
(
$">
{
a
}
<"
);
Console
.
WriteLine
(
$">
{
a
,
14
}
<"
);
// Für Ausgabe 14 Stellen verwenden, rechtsbündig formatieren
Console
.
WriteLine
(
$">
{
a
,-
14
}
<"
);
// Für Ausgabe 14 Stellen verwenden, linksbündig formatieren
Console
.
WriteLine
(
$">
{
a
,
14
:
f2
}
<"
);
// dto, Ausgabe auf zwei Stellen runden
Console
.
WriteLine
(
$">
{
a
,
14
:
f3
}
<"
);
// dto, Ausgabe auf drei Stellen runden
}
}
}
02Ausgabeaufbereitungen/Properties/AssemblyInfo.cs
0 → 100644
View file @
3364e8ab
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[
assembly
:
AssemblyTitle
(
"02Ausgabeaufbereitungen"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"02Ausgabeaufbereitungen"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2018"
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[
assembly
:
ComVisible
(
false
)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[
assembly
:
Guid
(
"924685c3-2392-42eb-a850-1772f3942fe9"
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[
assembly
:
AssemblyVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"1.0.0.0"
)]
02Datentypen02/02Datentypen02/Program.cs
View file @
3364e8ab
...
...
@@ -20,7 +20,7 @@ namespace _02Datentypen02
// Besondere Vorsicht bei gemischten Ausdrücken
Console
.
WriteLine
(
i
);
Console
.
WriteLine
(
j
);
Console
.
WriteLine
(
">>{
0,-
12:f
}
<<<"
,
a
);
Console
.
WriteLine
(
$
">>
{
a
,
12
:
f
2
}
Euro
<<<"
);
int
zahl
=
10
;
if
(
zahl
%
2
!=
0
&&
zahl
%
3
!=
0
&&
zahl
%
5
!=
0
&&
...
...
02Fallunterscheidungen2/02Fallunterscheidungen2.csproj
0 → 100644
View file @
3364e8ab
<?xml version="1.0" encoding="utf-8"?>
<Project
ToolsVersion=
"15.0"
xmlns=
"http://schemas.microsoft.com/developer/msbuild/2003"
>
<Import
Project=
"$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props"
Condition=
"Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')"
/>
<PropertyGroup>
<Configuration
Condition=
" '$(Configuration)' == '' "
>
Debug
</Configuration>
<Platform
Condition=
" '$(Platform)' == '' "
>
AnyCPU
</Platform>
<ProjectGuid>
{3D3A89BA-5645-4839-8EE4-AAF2A79AC01A}
</ProjectGuid>
<OutputType>
Exe
</OutputType>
<RootNamespace>
_02Fallunterscheidungen2
</RootNamespace>
<AssemblyName>
02Fallunterscheidungen2
</AssemblyName>
<TargetFrameworkVersion>
v4.6.1
</TargetFrameworkVersion>
<FileAlignment>
512
</FileAlignment>
<AutoGenerateBindingRedirects>
true
</AutoGenerateBindingRedirects>
<Deterministic>
true
</Deterministic>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugSymbols>
true
</DebugSymbols>
<DebugType>
full
</DebugType>
<Optimize>
false
</Optimize>
<OutputPath>
bin\Debug\
</OutputPath>
<DefineConstants>
DEBUG;TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "
>
<PlatformTarget>
AnyCPU
</PlatformTarget>
<DebugType>
pdbonly
</DebugType>
<Optimize>
true
</Optimize>
<OutputPath>
bin\Release\
</OutputPath>
<DefineConstants>
TRACE
</DefineConstants>
<ErrorReport>
prompt
</ErrorReport>
<WarningLevel>
4
</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference
Include=
"System"
/>
<Reference
Include=
"System.Core"
/>
<Reference
Include=
"System.Xml.Linq"
/>
<Reference
Include=
"System.Data.DataSetExtensions"
/>
<Reference
Include=
"Microsoft.CSharp"
/>
<Reference
Include=
"System.Data"
/>
<Reference
Include=
"System.Net.Http"
/>
<Reference
Include=
"System.Xml"
/>
</ItemGroup>
<ItemGroup>
<Compile
Include=
"Program.cs"
/>
<Compile
Include=
"Properties\AssemblyInfo.cs"
/>
</ItemGroup>
<ItemGroup>
<None
Include=
"App.config"
/>
</ItemGroup>
<Import
Project=
"$(MSBuildToolsPath)\Microsoft.CSharp.targets"
/>
</Project>
\ No newline at end of file
02Fallunterscheidungen2/App.config
0 → 100644
View file @
3364e8ab
<?
xml
version
=
"1.0"
encoding
=
"utf-8"
?>
<
configuration
>
<
startup
>
<
supportedRuntime
version
=
"v4.0"
sku
=
".NETFramework,Version=v4.6.1"
/>
</
startup
>
</
configuration
>
\ No newline at end of file
02Fallunterscheidungen2/Program.cs
0 → 100644
View file @
3364e8ab
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Threading.Tasks
;
namespace
_02Fallunterscheidungen2
{
class
Program
{
static
void
Main
(
string
[]
args
)
{
int
anzTage
=
Convert
.
ToInt32
(
Console
.
ReadLine
());
double
preis
;
if
(
anzTage
<=
3
)
preis
=
89.50
;
else
if
(
anzTage
<=
10
)
preis
=
79.50
;
else
preis
=
60.00
;
Console
.
WriteLine
(
preis
);
}
}
}
02Fallunterscheidungen2/Properties/AssemblyInfo.cs
0 → 100644
View file @
3364e8ab
using
System.Reflection
;
using
System.Runtime.CompilerServices
;
using
System.Runtime.InteropServices
;
// Allgemeine Informationen über eine Assembly werden über die folgenden
// Attribute gesteuert. Ändern Sie diese Attributwerte, um die Informationen zu ändern,
// die einer Assembly zugeordnet sind.
[
assembly
:
AssemblyTitle
(
"02Fallunterscheidungen2"
)]
[
assembly
:
AssemblyDescription
(
""
)]
[
assembly
:
AssemblyConfiguration
(
""
)]
[
assembly
:
AssemblyCompany
(
""
)]
[
assembly
:
AssemblyProduct
(
"02Fallunterscheidungen2"
)]
[
assembly
:
AssemblyCopyright
(
"Copyright © 2018"
)]
[
assembly
:
AssemblyTrademark
(
""
)]
[
assembly
:
AssemblyCulture
(
""
)]
// Durch Festlegen von ComVisible auf FALSE werden die Typen in dieser Assembly
// für COM-Komponenten unsichtbar. Wenn Sie auf einen Typ in dieser Assembly von
// COM aus zugreifen müssen, sollten Sie das ComVisible-Attribut für diesen Typ auf "True" festlegen.
[
assembly
:
ComVisible
(
false
)]
// Die folgende GUID bestimmt die ID der Typbibliothek, wenn dieses Projekt für COM verfügbar gemacht wird
[
assembly
:
Guid
(
"3d3a89ba-5645-4839-8ee4-aaf2a79ac01a"
)]
// Versionsinformationen für eine Assembly bestehen aus den folgenden vier Werten:
//
// Hauptversion
// Nebenversion
// Buildnummer
// Revision
//
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// übernehmen, indem Sie "*" eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[
assembly
:
AssemblyVersion
(
"1.0.0.0"
)]
[
assembly
:
AssemblyFileVersion
(
"1.0.0.0"
)]
02Primzahltest1/02Primzahltest1/Program.cs
View file @
3364e8ab
...
...
@@ -10,25 +10,27 @@ namespace _02Primzahltest1
{
static
void
Main
(
string
[]
args
)
{
int
zahl
=
97
;
int
anzTeiler
=
0
;
for
(
int
teiler
=
2
;
teiler
<
zahl
;
teiler
++)
for
(
int
zahl
=
3
;
zahl
<=
1000
;
zahl
++)
{
int
rest
=
zahl
%
t
eiler
;
if
(
rest
==
0
)
int
anzT
eiler
=
0
;
for
(
int
teiler
=
2
;
teiler
<
zahl
;
teiler
++
)
{
//Console.WriteLine($"{zahl} ist durch {teiler} teilbar");
anzTeiler
++;
int
rest
=
zahl
%
teiler
;
if
(
rest
==
0
)
{
//Console.WriteLine($"{zahl} ist durch {teiler} teilbar");
anzTeiler
++;
}
//else
// Console.WriteLine($"{zahl} ist NICHT durch {teiler} teilbar");
}
//for (int i = 0; i < 100000000; i++) ;
if
(
anzTeiler
==
0
)
Console
.
WriteLine
(
$"
{
zahl
}
ist eine Primzahl"
);
//else
// Console.WriteLine($"{zahl} ist
NICHT durch {t
eiler}
t
eil
bar
");
// Console.WriteLine($"
Nein!
{zahl} ist
keine Primzahl. Sie hat {anzT
eiler}
T
eil
er.
");
}
for
(
int
i
=
0
;
i
<
100000000
;
i
++)
;
if
(
anzTeiler
==
0
)
Console
.
WriteLine
(
$"
{
zahl
}
ist eine Primzahl"
);
else
Console
.
WriteLine
(
$"Nein!
{
zahl
}
ist keine Primzahl. Sie hat
{
anzTeiler
}
Teiler."
);
}
}
}
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