Reorder
This commit is contained in:
20
Exercises/E07_DateTime/Exercise_1.cs
Normal file
20
Exercises/E07_DateTime/Exercise_1.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Data.Common;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_1
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole das heutige Datum ausgegeben wird.
|
||||
//Code START
|
||||
dynamic dt = -1;
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy"));
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E07_DateTime/Exercise_2.cs
Normal file
20
Exercises/E07_DateTime/Exercise_2.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_2
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole die aktuelle Uhrzeit ausgegeben wird.
|
||||
int hour = 0;
|
||||
int minute = 0;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine("{0}:{1} Uhr", hour, minute);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_3.cs
Normal file
19
Exercises/E07_DateTime/Exercise_3.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_3
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole der 13.02.1998 12:53:52 ausgegeben wird.
|
||||
//Code START
|
||||
dynamic dt = -1;
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy hh:mm:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_4.cs
Normal file
19
Exercises/E07_DateTime/Exercise_4.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_4
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Sorgen Sie dafür, dass auf der Konsole die Zahl 101 ausgegeben wird.
|
||||
DateTime dt = new DateTime(1,2,3,4,5,6);
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.Day + dt.Hour);
|
||||
}
|
||||
}
|
||||
}
|
||||
19
Exercises/E07_DateTime/Exercise_5.cs
Normal file
19
Exercises/E07_DateTime/Exercise_5.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_5
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Ziehen Sie von dem angegeben Datum eine Stunde ab und addieren Sie drei Tage drauf.
|
||||
DateTime dt = DateTime.Now;
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
Console.WriteLine(dt.ToString("dd.MM.yyyy hh:mm:ss"));
|
||||
}
|
||||
}
|
||||
}
|
||||
18
Exercises/E07_DateTime/Exercise_6.cs
Normal file
18
Exercises/E07_DateTime/Exercise_6.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_6
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Zeigen Sie auf der Konsole die Millisekunden und die Microsekunden der aktuellen Uhrzeit an.
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
20
Exercises/E07_DateTime/Exercise_7.cs
Normal file
20
Exercises/E07_DateTime/Exercise_7.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Exercises_C_Sharp.E07_DateTime
|
||||
{
|
||||
class Exercise_7
|
||||
{
|
||||
public static void Start()
|
||||
{
|
||||
//Wie viel Zeit liegt zwischen den beiden Daten? Geben Sie diese vollständig auf der Konsole aus (Jahr bis Sekunde).
|
||||
DateTime dt1 = new DateTime(1999, 12, 31, 11, 59, 59);
|
||||
DateTime dt2 = DateTime.Now;
|
||||
|
||||
//Code START
|
||||
|
||||
//Code ENDE
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user