1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Dafna1 [17]
2 years ago
6

please remember that project 10 cannot be submitted late. first, write a class named movie that has four data members: title, ge

nre, director, and year. it should have: an init method that takes as arguments the title, genre, director, and year (in that order) and assigns them to the data members. the year is an integer and the others are strings. get methods for each of the data members (get title, get genre, get director, and get year). next write a class named streamingservice that has two data members: name and catalog. the catalog is a dictionary of movies, with the titles as the keys and the movie objects as the corresponding values (you can assume there aren't any movies with the same title). the streamingservice class should have: an init method that takes the name as an argument, and assigns it to the name data member. the catalog data member should be initialized to an empty dictionary. get methods for each of the data members (get name and get catalog). a method named add movie that takes a movie object as an argument and adds it to the catalog. a method named delete movie that takes a movie title as an argument and if that movie is in the catalog, removes it. lastly, write a class named streamingguide that has one data member, a list of streamingservices. it should have: an init method that takes no arguments and initializes the data member to an empty list. a method called add streaming service that takes a streamingservice object as an argument and adds it to the list. a method named delete streaming service that takes the name of a streaming service as an argument and if it's in the list, removes it. a method named where to watch that takes a movie title as an argument and returns a list. element 0 of the list is a string that is the concatenation of the name and year of the movie (with the year in parentheses), with the rest of the list being the names of streaming services showing that movie. for example, the list that is returned might look like this: ['king kong (1933)', 'hbo max', 'epix', 'kanopy']. if the movie is not available on any of the streamingservices, the method should return none. so a streamingguide will have a list of streamingservices, and a streaming service will have a dictionary of movies. the where to watch method needs to use this nested information to determine which streamingservices, if any, have the desired movie available. here's a simple example of how your code might be used: movie 1
Computers and Technology
1 answer:
Andru [333]2 years ago
6 0

Using the knowledge of computational language in python we can write the code as write a class named movie that has four data members: title, genre, director, and year

<h3>Writting the code:</h3>

<em>class Movie:</em>

<em>    def __init__(self, title,genre,director,year):</em>

<em>        self.title = title</em>

<em>        self.genre = genre</em>

<em>        self.director = director</em>

<em>        self.year = year</em>

<em />

<em>class StreamingService:</em>

<em>    catalog = dict()</em>

<em>    def __init__(self, name):</em>

<em>        self.name = name</em>

<em />

<em>    def add_movie(self,mov):</em>

<em>        self.catalog[mov.title] = mov</em>

<em>    </em>

<em>    def delete_movie(self,delName):</em>

<em>        self.catalog.pop(delName)</em>

<em />

<em>    def isPresent(self,movName):</em>

<em>        if movName in self.catalog.keys():</em>

<em>            return True</em>

<em />

<em>class StreamingGuide:</em>

<em>    def __init__(self):</em>

<em>        self.listOfServices = []</em>

<em />

<em>    def add_streaming_service(self,service):</em>

<em>        self.listOfServices.append(service)</em>

<em />

<em>    def delete_streaming_service(self,nm):</em>

<em>        self.todel = -1</em>

<em>        for i in range(len(self.listOfServices)):</em>

<em>            if(self.listOfServices[i].name == nm):</em>

<em>                self.todel = i</em>

<em>        self.listOfServices.pop(self.todel)</em>

<em />

<em>    def where_to_watch(self,movieName):</em>

<em>        lst = []</em>

<em>        for service in self.listOfServices:</em>

<em>            if(service.isPresent(movieName)):</em>

<em>                lst.append(service.name)</em>

<em>        return lst</em>

<em />

<em />

<em>movie_1 = Movie('The Seventh Seal', 'comedy', 'Ingmar Bergman', 1957)</em>

<em>movie_2 = Movie('Home Alone', 'tragedy', 'Chris Columbus', 1990)</em>

<em>movie_3 = Movie('Little Women', 'action thriller', 'Greta Gerwig', 2019)</em>

<em>movie_4 = Movie('Galaxy Quest', 'historical documents', 'Dean Parisot', 1999)</em>

<em />

See more about python at brainly.com/question/18502436

#SPJ1

You might be interested in
1. Perform the following Binary Additions 101101 + 10100 *
USPshnik [31]

Answer:

1.         carry   1  1  1

                      1  0 1 1 0 1

                      +  1 0 1 0 0

                       ------------------------

   Answer: 1  0 0 0  0 0 1  

2.         carry  1 1  1 0 1  1  

                     0 1 0 1 0 0 1 1

                  + 0 1 1  1 0  1  1 0

                  --------------------------

    Answer: 0 1  1 0 0 1 0 0 1

3.                   1 0 1 1 0 1

                    -   1 0 1 0 0

                   -------------------------

       Answer: 0 1 1 0 0 1

4.                      1 1 0 0 1 0 1 1

                      -    1 0 1 0 1 1 0

                     -----------------------------

        Answer:   01 1 1 0 1 0 1

Explanation:

In Binary addition when you add 1 + 1 = 0, carry over the 1, i.e 10

in Subtraction when you subtract 0-1 = 1,  brow 1 from left side, resulting in -1 carried over.

3 0
3 years ago
Read 2 more answers
How are cars made in georgia
Talja [164]

Answer:

Its same everywhere.

7 0
4 years ago
Write a program that asks the user to enter a number of seconds and then printsthe same amount of time in days, hours, minutes,
MariettaO [177]

Answer:3363 seconds

Explanation:3363 is equivalent to 0days 1 hour, 1 min, and 7 sec

8 0
4 years ago
Which of the following are considerations in e-commerce and e-government Internet sites? Check all of the boxes that apply.
vovangra [49]

Answer:

protection of sensitive information

Explanation:

6 0
3 years ago
Briefly explain the importance of doing backup in systems administration and explain in detail any three methods for performing
Dmitry_Shevchenko [17]

Answer:

Importance of backup in system administration:

Backups are crucial in system administrations for preserving continuity and protecting against specific types of hardware failures, service interruptions, and human mistakes. To aid a company in recovering from an unexpected catastrophe, backup copies make it possible to restore data to a previous point in time. To safeguard against primary data loss or corruption, it is essential to save a copies of data on a different media. When a system administrator create a backup, he makes a copy of the data that you can restore if your main data is lost. These errors may be the consequence of faulty hardware or software, corrupted data, or a human error like a targeted attack or an unintentional deletion. System backup and recovery is therefore a crucial skill for system administrators as well as the companies they work for.

Three methods for performing backup:

  1. Disk image: A efficient method to back up not only the files and directories but also everything else on the system is by creating a disk image. If a user have a disk image, the user can restore everything, including the operating system, applications, data, and more, so the user won't have to worry about any difficulties. Placing the  disk image-containing DVD into the DVD-ROM to restore the backup. Additionally, just attach an external HDD to the computer if the user have a disk image that they made.
  2. External hard drive: The most common backup method is to use an external hard drive or even a USB flash drive. An HDD can be easily, quickly, and affordably backed up. It is effective since consumers may carry their portable backup with them wherever they go.
  3. Cloud backup: Cloud backup or Online backup has been around for a while, but not many people really utilize it. But the greatest backup technique by far is cloud backup. The user does not have to worry about hardware problems because their files are saved in the cloud and can be accessed from anywhere because the backups are automatically produced and everything is synchronized. It is one of the greatest methods to backup, especially when you consider that the contents are encrypted and stored securely.

6 0
2 years ago
Other questions:
  • Fibre channel switched networks rely on the concept of a ___________________which is a fundamental concept in how the network wo
    10·1 answer
  • Which of the following is NOT an example of systems software?
    9·1 answer
  • 100 students were asked to fill out a form with three survey questions, as follows: H: Honor Roll C: Club membership (Robotics C
    7·1 answer
  • Witch word in the sentence is a noun? the food he is cooking smells delicious.
    7·1 answer
  • Lionel wants to find images of colonies of Emperor penguins to use for a school project. Which of the following phrases should h
    15·1 answer
  • How to format an APA paper set it up
    15·1 answer
  • Define a function typeHistogram that takes an iterator ""it"" (representing a sequence of values of different types) and builds
    12·1 answer
  • Ismael is examining a report in Access. He needs to access a view that will be used to examine and change the structure of the r
    9·2 answers
  • What the advantages and disadvantages of file sharing to the users​
    9·1 answer
  • PYTHON --- Toll roads have different fees based on the time of day and on weekends. Write a function calc_toll() that has three
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!