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
konstantin123 [22]
3 years ago
14

Define a Course base class with attributes number and title. Define a print_info() method that displays the course number and ti

tle.
Also define a derived class OfferedCourse with the additional attributes instructor_name, term, and class_time.
Ex: If the input is:
ECE287
Digital Systems Design
ECE387
Embedded Systems Design
Mark Patterson
Fall 2018
WF: 2-3:30 pm
the output is:
Course Information:
Course Number: ECE287
Course Title: Digital Systems Design
Course Information:
Course Number: ECE387
Course Title: Embedded Systems Design
Instructor Name: Mark Patterson
Term: Fall 2018 Class
Time: WF: 2-3:30 pm

Computers and Technology
1 answer:
lesya [120]3 years ago
7 0

Answer:

Here is the Python program:

class Course:

   def __init__(self,number, title):

       self.number = number

       self.title = title

   def print_info(self):

       print("Course Information:")  

       print("Course Number:", self.number)

       print("Course Title:", self.title)

class OfferedCourse(Course):

   def __init__(self, number, title,instructor_name,term,class_time):

       self.number = number

       self.title = title

       self.instructor_name = instructor_name

       self.term = term

       self.class_time=class_time

if __name__ == "__main__":

   course_number = input()

   course_title = input()

   o_course_number = input()

   o_course_title = input()

   instructor_name = input()

   term = input()

   class_time = input()

   my_course = Course(course_number, course_title)

   my_course.print_info()

   my_offered_course = OfferedCourse(o_course_number, o_course_title, instructor_name, term, class_time)

   my_offered_course.print_info()

   print('Instructor Name:', my_offered_course.instructor_name)

   print('Term:', my_offered_course.term)

   print('Class Time:', my_offered_course.class_time)

Explanation:

Course is a base class with attributes number and title. It has a print_info() method that displays the course number and title.

self keyword is the keyword which is used to easily access all the instances defined within a Course class, including its method and attributes number and title.

__init__ is a constructor which is called when an instance is created from the Course, and access is required to initialize the attributes number and title of Course class.

OfferedCourse is a class which is derived from base class Course. In addition to attributes number and title, it has attributes attributes instructor_name, term, and class_time.

A special attribute __name__. The value of __name__ attribute is set to “__main__” in order to run this module as a main program. In this main program input() method is used to take input from user. The input is the course number, title, instructor name, term and class time. The object my_course of Course class is created and the constructor of Course class is called passing the course_number and course_title using this object to access the attributes (member variables number and term) of the Course class. Next the instance my_course is used to call function print_info() of Course class.

The object my_offered_course of OfferedCourse class is created and the constructor of OfferedCourse class is called passing the o_course_number, o_course_title, instructor_name, term, class_time using this object to access the attributes number, title, instructor_name,term, class_time OfferedCourse class. Next the instance my_offered_course is used to call function print_info() of Course class. Here it is to be noticed that the derived class OfferedCourse uses the method print_info() of its base class Course. Last three print statements of the main program use object my_offered_course to access the attributes  instructor_name, term and class_time of class OfferedCourse to display the their values.

The screenshot of the program output is attached.

You might be interested in
An attacker gained remote access to a user's computer by exploiting a vulnerability in a piece of software on the device. The at
Anni [7]

"A Buffer overflow" vulnerability exploit resulted from the attacker's actions.

Whenever a software or an application writes too much data into a buffer, causing neighboring storage regions to have been corrupted as a consequence, this could be determined as Buffer overflow.

⇒ There are two kinds of Buffer overflow attacks such as:

  • <u>Stack-based</u> - It will become more popular to use such memory, as well as that's only available during implementation of any code.
  • <u>Heap-based</u> - Those attacks seem to be more difficult to execute because they entail overflowing overall storage capacity allotted for a program further than the space needed for something like the program's present activities.

Thus we can say that the correct answer is a Buffer overflow.

Learn more about Buffer overflow here:

brainly.com/question/4952591

6 0
3 years ago
Which best describes a career that would rely on both and employer and the federal government for funding? Electro-Mechanical Te
Dmitrij [34]

Answer:

<u>University Research Professor</u>

Explanation:

A university Professor can identify a research in his/her area of study and prepare a proposal for funding.This could be a research that will impact the nation thus a proposal could be presented to the federal government for funding. Additionally, the Professor can present the same proposal to the university research department to request funding of the project.The University which employed the Professor will now fund that project research and make it public to members of the community about the research that the University is undertaking with the professor as the leader of the research.

8 0
4 years ago
In a(n) ____________________ device, the movement of electrons performs essentially the same functions as gears and wheels in me
lana66690 [7]

Answer:

Electronic computing.

Explanation:

8 0
2 years ago
What does it mean when it says this person is unavailable on messenger.
arsen [322]

Answer:

The user has a deactivated account 

Explanation:

or the user does not have the account anymore good luck and I hope you do well <3

4 0
2 years ago
What can be controlled through IoT? Choose four answers.
Maru [420]

<em>The answer is: </em>

<em> </em>

<em>Door locks, light switches, security cameras and desktops (even laptops too) </em>

<em> </em>

<em>When we say Internet of Things, it is basically all objects that can be connected to internet (objects that are parts of our daily lives) can be included in this phrase or quote). There are technologies pertaining to common household items such as locks, switches and cameras that can be controlled through the use of phones and internet. These things collect and stores data such as names, fingerprints, pictures and scans that are used for verification and authentication purposes. </em>

<em> </em>

<em />

5 0
3 years ago
Other questions:
  • In which type of network will a problem with one computer crash the network?
    8·1 answer
  • Use the get_seconds function to work out the amount of seconds in 2 hours and 30 minutes, then add this number to the amount of
    13·1 answer
  • ¿Por qué es importante generar proyectos innovadores?
    8·1 answer
  • A Programmer uses what piece of software?*
    12·1 answer
  • Whay device is recommended to use to install windows 10
    13·1 answer
  • It is an island country; it fought against us in World War II; it is known for sushi.
    14·2 answers
  • Given the following snippet of code, answer the following two questions based on the code: typedef enum {Sun, Mon, Tue, Wed, Thu
    15·1 answer
  • When was "Rick Astley Never Gonna Give You Up" originally made?
    6·2 answers
  • 4. Word Separator:Write a program that accepts as input a sentence in which all of thewords are run together but the first chara
    10·1 answer
  • State the name of the following computer components​
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!