C# - C Sharp: Practical 14: Users Management System

Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực

USERS MANAGEMENT SYSTEM

1. Create an interface called IUser in 2 files with these members:

IUserPro.cs:

a. Properties:

   int ID;                  => Index of the User, start from 1 to n
   string Name;        => User Name
   string Password;  => Password

b. Indexer:

   int? PhoneList

IUserMethod.cs:

   void Display()

2. Create a class name User

a. Implement interface IUser.

b. Indexer PhoneList implements a List<int?> type variable at the specified index. If the specified index is out of boudary, then return null.

c. The Display method will print Name, Password and all the phone numbers in PhoneList of User to console.

3. Build the menu:

1. Add User
2. Check User
3. Display all Users

4. If user chooses 1, then:

a. Create a new User object.

b. Set ID = Total users + 1.

c. Set Name = Read from console.

d. Set Password = Read from console.

e. Asks User to input number of phones and enter these phone to PhoneList.

f. Add the user to an Dictionary<int, IUser> with Key = UserID and Value = user.

5. If user chooses 2, then:

a. Ask user to enter ID.

b. Ask user to enter Name.

c. Ask user to enter Password.

d. Check in the Dictionary if the UserName and Password is match. If UserName and Password is match, show the message “User Checked” else show the message “User not found”.

6. If user chooses 3, then:

Display all Users and their phone numbers to the console using their Display method.

» Tiếp: Quiz
« Trước: Practical 13: Football Management System
Các khóa học qua video:
Python SQL Server PHP C# Lập trình C Java HTML5-CSS3-JavaScript
Học trên YouTube <76K/tháng. Đăng ký Hội viên
Viết nhanh hơn - Học tốt hơn
Giải phóng thời gian, khai phóng năng lực
Copied !!!