Question la. Define a class that satisfies the following specifications. Class Name Constructor Parameters Class Attribute | Catalogue 1. A string object, serial_num This class has two class attributes 1. A dictionary, tv_channels This attribute is a dictionary object with the following key value pairs Keys (string type) "NetFlix" "Amazon Prime Video" "Apple TV+" "Disney+" "HBO Go" "iQiyi" Values (float type) 12.98 2.99 6.98 11.98 13.98 8.98 2. A string. hotline This attribute is a string object with the value "1800-1234-4567" Instance attribute |In the constructor, assign the parameter to an instance attribute of the same name. Question Ib. Define a class method that satisfies the following specifications. Method name Method type Method Parameters Detailed Information Display the text "Available for subscription:" display This is a class method Next, in a new line, display to the console the key value pairs of the class attribute, tv_channels. The display should have two columns with the headings "Channels" and "Price/mth". The channel column should display the keys in the class attribute, left- aligned with a minimum width of 22 characters. The price column must be right-aligned with a minimum width of 9 characters. The prices must be formatted with a S in front, and to 2 decimal places. Available for subscription: Example of 1 four lines of console display Channels NetFlix Amazon Prime Video Price/mth $12.98 $2.99 Question le. Define an class method that satisfies the following specifications. |get_subscription This is an elass method Method name Method type Method Parameters Method return values Detailed Information Using the class attribute Catalogue.tv_channels, and the prompts 1. a list of string objects shown in the next row in the table, get the channel names which the user will like to subscribe to. Append the channel names into a list and return it. The method should handle user input of both upper and lower case letters of Y and N. Example code x - Catalogue.get_subscription () Example of the console display Subscribe to NetFlix? (Y/N): Y Subscribe to Amazon Prime Video? (Y/N) : N Subacribe to Apple TV+? (Y/N) : N Subscribe to Disney+? (Y/N) : N Subscribe to HBO Go? (Y/N) : Y Subscribe to 10iyi? (Y/N): N Value of x ("NetFlix", "HBO Go")

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
Question la. Define a class that satisfies the following specifications.
Catalogue
1. A string object, serial_num
Class Name
Constructor
Parameters
| Class Attribute
This class has two class attributes
1. A dictionary, tv_channels
This attribute is a dictionary object with the following key value pairs
Keys (string type)
"NetFlix"
"Amazon Prime Video"
Values (float type)
12.98
2.99
| "Apple TV+"
"Disney+"
6.98
11.98
"HBO Go"
13.98
"iQiyi"
8.98
2. A string. hotline
This attribute is a string object with the value "1800-1234-4567"
Instance attribute
In the constructor, assign the parameter to an instance attribute of the same
name.
Question 1b. Define a class method that satisfies the following specifications.
display
This is a class method
Method name
Method type
Method Parameters
Detailed Information Display the text "Available for subscription:"
Next, in a new line, display to the console the key value pairs of the class
attribute, tv_channels.
The display should have two columns with the headings "Channels" and
"Price/mth".
The channel column should display the keys in the class attribute, left-
aligned with a minimum width of 22 characters.
The price column must be right-aligned with a minimum width of 9
characters. The prices must be formatted with a S in front, and to 2 decimal
places.
Example of 1" four
lines of console
display
Available for subscription:
Channels
Price/mth
$12.98
$2.99
NetFlix
Amazon Prime Video
Question le. Define an elass method that satisfies the following specifications.
Method name
Method type
Method Parameters
get_subscription
This is an class method
Method return values
1. a list of string objects
Detailed Information Using the class attribute Catalogue.tv_channels, and the prompts
shown in the next row in the table, get the channel names which the user
will like to subscribe to. Append the channel names into a list and return it.
The method should handle user input of both upper and lower case letters
of Y and N.
x - Catalogue.get_subscription ()
Example code
Example of the
console display
Subscribe to NetFlix? (Y/N) : Y
Subscribe to Amazon Prime Video? (Y/N) : N
Subscribe to Apple TV+? (Y/N): N
Subscribe to Disney+? (Y/N) : N
Subscribe to HBO Go? (Y/N): Y
Subscribe to iQiyi? (Y/N) : N
Value of x
["NetFlix", "HBO Go")
Transcribed Image Text:Question la. Define a class that satisfies the following specifications. Catalogue 1. A string object, serial_num Class Name Constructor Parameters | Class Attribute This class has two class attributes 1. A dictionary, tv_channels This attribute is a dictionary object with the following key value pairs Keys (string type) "NetFlix" "Amazon Prime Video" Values (float type) 12.98 2.99 | "Apple TV+" "Disney+" 6.98 11.98 "HBO Go" 13.98 "iQiyi" 8.98 2. A string. hotline This attribute is a string object with the value "1800-1234-4567" Instance attribute In the constructor, assign the parameter to an instance attribute of the same name. Question 1b. Define a class method that satisfies the following specifications. display This is a class method Method name Method type Method Parameters Detailed Information Display the text "Available for subscription:" Next, in a new line, display to the console the key value pairs of the class attribute, tv_channels. The display should have two columns with the headings "Channels" and "Price/mth". The channel column should display the keys in the class attribute, left- aligned with a minimum width of 22 characters. The price column must be right-aligned with a minimum width of 9 characters. The prices must be formatted with a S in front, and to 2 decimal places. Example of 1" four lines of console display Available for subscription: Channels Price/mth $12.98 $2.99 NetFlix Amazon Prime Video Question le. Define an elass method that satisfies the following specifications. Method name Method type Method Parameters get_subscription This is an class method Method return values 1. a list of string objects Detailed Information Using the class attribute Catalogue.tv_channels, and the prompts shown in the next row in the table, get the channel names which the user will like to subscribe to. Append the channel names into a list and return it. The method should handle user input of both upper and lower case letters of Y and N. x - Catalogue.get_subscription () Example code Example of the console display Subscribe to NetFlix? (Y/N) : Y Subscribe to Amazon Prime Video? (Y/N) : N Subscribe to Apple TV+? (Y/N): N Subscribe to Disney+? (Y/N) : N Subscribe to HBO Go? (Y/N): Y Subscribe to iQiyi? (Y/N) : N Value of x ["NetFlix", "HBO Go")
Expert Solution
steps

Step by step

Solved in 3 steps with 2 images

Blurred answer
Knowledge Booster
User Defined DataType
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education