Advertisement
Guest User

Untitled

a guest
Aug 22nd, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.04 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace Terminkalender_Aufg
  8. {
  9.  
  10. class Program
  11. {
  12.     static void Main (string[] args)
  13.     {
  14.         double termindauer = 0;
  15.  
  16.         Termin termin = new Termin();
  17.  
  18.         termin.Eingabe();
  19.  
  20.         Console.WriteLine("Dauer:" + termin.Dauer());
  21.         Console.ReadKey();
  22.  
  23.     }
  24.  
  25. }
  26.  
  27.     class Termin
  28.     {
  29.         DateTime Start;
  30.         DateTime Ende;
  31.         string Bezeichnung;
  32.  
  33.         public void Eingabe()
  34.         {
  35.             Console.WriteLine("Termin Start: ");
  36.             Start = Convert.ToDateTime(Console.ReadLine());
  37.  
  38.             Console.WriteLine("Termin Ende: ");
  39.             Ende = Convert.ToDateTime(Console.ReadLine());
  40.  
  41.             Console.WriteLine("Bezeichung: ");
  42.             Bezeichnung = Console.ReadLine();
  43.         }
  44.  
  45.         public double Dauer()
  46.         {
  47.         double termindauer = Ende.Subtract(Start).TotalMinutes;
  48.         return (termindauer);
  49.         }
  50.  
  51.  
  52.     }
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement