Advertisement
Guest User

Untitled

a guest
Dec 13th, 2011
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.27 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading;
  6.  
  7. namespace ConsoleApplication1
  8. {
  9.     enum KepzesTipus
  10.     {
  11.         Nappali,
  12.         Esti,
  13.         Levelezo
  14.     }
  15.  
  16.     class Hallgato
  17.     {
  18.         private KepzesTipus kepzestipus;
  19.         private int evfolyam = 0;
  20.         private int azonosito = 100 - 1;
  21.         private double erdemjegy = 0;
  22.  
  23.         public Hallgato()
  24.         {
  25.             Thread.Sleep(100);
  26.             Random rand_hallgato = new Random();
  27.             this.kepzestipus = (KepzesTipus)rand_hallgato.Next(0, 3);
  28.             this.evfolyam = rand_hallgato.Next(1990, 2011);
  29.             this.azonosito++;
  30.             this.erdemjegy = rand_hallgato.NextDouble() * (5.0 - 1.0) + 1.0;
  31.         }
  32.  
  33.         public string hallgatoAdatai()
  34.         {
  35.             return kepzestipus + ", " + evfolyam + ", " + azonosito + ", " + erdemjegy;
  36.         }
  37.     }
  38.  
  39.     class Adatbazis
  40.     {
  41.     }
  42.  
  43.     class Program
  44.     {
  45.         static void Main(string[] args)
  46.         {
  47.             Hallgato elso = new Hallgato();
  48.            
  49.             //1. függvény tesztelése
  50.             Console.WriteLine(elso.hallgatoAdatai());
  51.            
  52.             //2. függvény tesztelése
  53.         }
  54.     }
  55. }
  56.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement