C# - C Sharp: Practical 10: Movies 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

MOVIES MANAGEMENT SYSTEM

In this exam, you’ll have to create a Movies Management system. The system allows input, list, search … movies.

1. Create an interface name IMovie  contains these properties and methods:

a. Properties:

ID (int)

Name (string)

PublishDate (DateTime)

 Director (string)

 Subtitle(string)

 AverageRate (float) – Read only property

b. Methods:

void Display()

2. Create a class name Movie:

a. Implements the IMovie interface.

b. The method Display will print all Name, PublishDate, Director, Language and AverageRate of the movie  to the console.

c. Declare an array name RateList type double has size of 3 elements.

d. Create an indexer uses the array RateList in step 2c.

e. Create a method named Calculate to set AverageRate = average of 3 double elements in AverageList array.

3. Create a class name  CustomList  that inherits from interface IEnumerable has some properties and methods:

a. private ArrayList MovieList;

b. public void Add(IMovie movie);

c. public void Remove(IMovie movie); //remove movie from MovieList

d. public void Sort(IComparer comp); //sort the items in MovieList with Icomparer comp

e. class CustomList allows user to iterate each item in MovieList.

4. Create a class name CustomSort that allows user sort IMovie items  in MovieList of class CustomList by their AverageList.

5. Display  a tasks menu to choose:

PLEASE AN OPTION:

   1. Insert new Movie
   2. View list of Movie
   3. Sort Movie by Average List
   4. Delete a movie
   5. Exit

6. If user type 1 from keyboard then:

a. Create a new Movie  instance and input Name, PublishDate, Director, Language and then ask user to enter 3 rating points and set to the instance indexer:

- The ID is auto increament ( ID++ )

- Be sure to check format of PublishDate

b. Create a CustomList to keep the Movie instance in MovieList

7. If user type 2 from keyboard then:

Loop from all movie instances in the CustomList then executes the Display method and Calculate from Movie.

8. If user type 3 from keyboard then:

Sort all movie instances in the CustomList by  their AverageRate

9. While user not chooses Exit (type 5 from keyboard) then go back to the menu step 3 to ask user chooses an option.

» Tiếp: Practical 11: Students Management System
« Trước: Practical 9: Readers 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 !!!