Advertisement
Guest User

Untitled

a guest
Oct 17th, 2017
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 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 ConsoleApplication16
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<Kupac> N = new List<Kupac>();
  14. Ucitaj(N);
  15. Ispis(N);
  16. }
  17. static void Ucitaj(List<Kupac> N)
  18. {
  19. string izbor;
  20. do
  21. {
  22. Kupac a = new Kupac();
  23. Console.WriteLine("Unesite adresu: ");
  24. a.Adresa = Console.ReadLine();
  25. Console.WriteLine("Unesite telefon: ");
  26. a.Telefon = Console.ReadLine();
  27. Console.WriteLine("Unesite email: ");
  28. a.Email = Console.ReadLine();
  29. Console.WriteLine("Unesite napomenu: ");
  30. a.Napomena = Console.ReadLine();
  31. N.Add(a);
  32. izbor = Console.ReadLine().ToUpper();
  33. } while (izbor == "DA");
  34.  
  35. }
  36. static void Ispis(List<Kupac> N)
  37. {
  38. foreach (Kupac i in N)
  39. {
  40. Console.WriteLine("Adresa: " + i.Adresa);
  41. Console.WriteLine("Telefon: " + i.Telefon);
  42. Console.WriteLine("Email: " + i.Email);
  43. Console.WriteLine("Napomena: " + i.Napomena);
  44. }
  45. }
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement