Advertisement
Guest User

Untitled

a guest
Nov 6th, 2017
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.71 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 ConsoleApp7
  8. {
  9. class Note
  10. {
  11. List<User> userID;
  12.  
  13. public Note ()
  14. {
  15. userID = new List<User>();
  16. }
  17.  
  18. public void AddUser(User another)
  19. {
  20. userID.Add(another);
  21. }
  22.  
  23. public void List()
  24. {
  25.  
  26. userID.ForEach(a =>
  27. {
  28. Console.WriteLine(a);
  29. });
  30. }
  31. }
  32.  
  33.  
  34.  
  35. class Book
  36. {
  37. List<Note> note;
  38. string bookID;
  39.  
  40.  
  41. public void AddNote(Note another)
  42. {
  43. note.Add(another);
  44. }
  45.  
  46. public void ShowAllNotes()
  47. {
  48.  
  49. note.ForEach(a =>
  50. {
  51. Console.WriteLine(a);
  52. });
  53. }
  54. }
  55.  
  56. class User
  57. {
  58. string ID;
  59. string password;
  60.  
  61. public User (string ID, string password)
  62. {
  63. this.ID = ID;
  64. this.password = password;
  65. }
  66.  
  67. }
  68.  
  69. class Program
  70. {
  71. static void Main(string[] args)
  72. {
  73.  
  74. string stop = null;
  75. Note one = new Note();
  76.  
  77.  
  78. while (stop != "Stop")
  79. {
  80. Console.WriteLine("Введите ваш ник и пароль:");
  81. string userName = Console.ReadLine();
  82. string userPassword = Console.ReadLine();
  83. User o = new User(userName, userPassword);
  84. one.AddUser(o);
  85. stop = Console.ReadLine();
  86. }
  87. }
  88. }
  89. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement