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
Which composer below was not part of the classical period? <br> A. Beethoven B. Bach<br> C. Mozart
castortr0y [4]

Explanation:

B. Bach

Thanks for your point

3 0
3 years ago
The limitation of trade secret protection for software is that it is difficult to prevent the ideas in the work from falling int
Lubov Fominskaja [6]

Answer:

The answer is "Option B".  

Explanation:

The main drawback of commercial security is, that the software may not protect digital technology against data mining, and they are not known to be the  imperial tools, that's why the only option B is correct, and certain options are wrong, which can be explained as follows:

  • In option A, It used to provide a sequence of instructions, which is used in security.  
  • In option C, It doesn't use in security, that's why it is wrong.
  • Option D and Option E are wrong because in software there is no use of court and new software, it only upgrades the software.
4 0
3 years ago
In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called _________.
KonstantinChe [14]

In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function

For better understanding, let us explain what the reshape function means

  • The numpy package helps to give the right tools for scientific and mathematical computations in python . it includes functions that cam be used to perform common linear algebra operations, fast Fourier transforms, and statistics The reshape function simply alter or change the row and column arrangement of data in numpy function and it is said to just give new shape to an array without the altering of its data.

from the above, we can therefore say that the answer In the NumPy function, the data preparation technique that is used to help machine learning algorithms is called the reshape technique or function is correct

learn more about reshape function  from:

brainly.com/question/24728884

3 0
2 years ago
A large, closet-sized computer capable of simultaneously processing data for hundreds or thousands of users is most likely a ___
Feliz [49]

Answer:

The correct answer is <u>mainframe</u>

I hope this helps! ^-^

4 0
2 years ago
Different algorithms can be made to complete the same task in different ways.
musickatia [10]

Answer:

True hope this helps you and everyone!

7 0
3 years ago
Read 2 more answers
Other questions:
  • The times per second an audio file is converted from analog to digital is the ______. audio file format bandwidth sample rate wa
    5·2 answers
  • Where does the term for a star network describe? A) a network for Department of Defense scientists to share data about the stars
    13·2 answers
  • If you think the user might enter 24.9, you should create a float variable. true or false
    9·1 answer
  • A firewall, when properly implemented, can prevent most attacks on your system.
    11·1 answer
  • On the Attendance worksheet, in cell L5, enter an IF function to determine if the percentage in cell K5 is greater than or equal
    9·1 answer
  • Which of the following is not a hazard a driver might encounter?
    5·1 answer
  • CAN SOMEONE PLEASE DO THESE FOR ME I WILL GIVE BRAINLIESR AND 20 POINTS PLEASE ITS ONLY 5 QUESTIONS PLEASEEEE
    12·1 answer
  • -) An attribute is a(n)?
    5·1 answer
  • ________ are the symbolic codes used in assembly language?​
    6·1 answer
  • Cybersquatters:_________.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!