public void returnMovie(string movieName) // this functions returns a movie
        {
            int borrowedMovieCount = borrowedDVD.Count;

            for (int i = 0; i < borrowedMovieCount; i++)
            {
                if (borrowedDVD[i] == movieName)
                {
                    borrowedDVD.RemoveAt(i);
                }
            }
        }
Exemple #2
0
        public bool removeMovie() // to remove a movie returns true if movie exits and remove it if movie doesnot exists it returns false
        {
            Console.WriteLine("Enter the movie name to be removed");
            string movieName       = Console.ReadLine();
            int    collectionCount = movieCollection.Count;

            for (int i = 0; i < collectionCount; i++)
            {
                if (movieCollection[i].getMovieTitle() == movieName)
                {
                    movieCollection.RemoveAt(i);
                    return(true);
                }
            }
            return(false);
        }