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
ASHA 777 [7]
2 years ago
9

Add a subclass FillInQuestion to the question hierarchy of Section 10.1. Such a question is constructed with a string that conta

ins the answer, surrounded by _ _, for example, "the inventor of Python was _Guido van Rossum_". The question should be displayed as 6 pts
The inventor of Python was _______
Below is the program that runs the modified class Question:
##
# Demonstrate the FillInQuestion class.
#
# Create the question and expected answer.
q = FillInQuestion()
q.setText("The inventor of Python was _Guido van Rossum_")
# Display the question and obtain user's response.
q.display()
response = input("Your answer: ")
print(q.checkAnswer(response))
a) Your code with comments
b) A screenshot of the execution
Identify the superclass and subclass in each of the following pairs of classes.
a) Employee, Manager
b) Student, GraduateStudent
c) Employee, Professor
d) Truck, Vehicle
use python to programe this Q and please make sure to include the commenst in the coding and make sure do not copy and past here i saw all the answers here in chegg but not what i want, and show me screenshot of the output
Computers and Technology
1 answer:
sattari [20]2 years ago
3 0

Answer:

class Question:

   def __init__(self):

       self.text = ""

       self.answer = ""

   def setText(self,text):

       self.text = text

   def setAnswer(self,answer):

       self.answer = answer

   def display(self):

       print(self.text)

   def checkAnswer(self,response):

       ans = self.answer.replace(' ','')

       ans = ans.lower()

       response = response.replace(' ','')

       response = response.lower()

       if(response == ans):

           return "Correct answer"

       else:

           return "Wrong answer"

class FillInQuestion (Question):

   def __init__(self):

       super(Question, self).__init__()

   def setText(self,text):

       temp = text.split("_")

       temp[0] = temp[0] + "_______"

       super(FillInQuestion,self).setText(temp[0])

       super(FillInQuestion, self).setAnswer(temp[1])

def main():

   # Create the question and expected answer.

   q = FillInQuestion()

   q.setText("The inventor of Python was _Guido van Rossum_")

   # Display the question and obtain user's response.

   q.display()

   response = input("Your answer: ")

   print(q.checkAnswer(response))

main()

Explanation:

The python program defines two classes, a parent class called Question and a child class called FillInQuestion. The screen shot of the output is seen below.

You might be interested in
Regarding the Internet of Things (IoT), a business involved in utilities, critical infrastructure, or environmental services can
love history [14]

Answer:

The answer is False

Explanation:

IOT or Internet of things refers to the multiple devices in the world today, which are connected to the internet, they gather and share specific information. Any physical object can become an IOT device once it can be connected to the internet to control its data.

Since, the business is involved in utilities, critical infrastructure, or environmental services, it will not benefit from traffic-monitoring applications.

7 0
3 years ago
What is the full form of bcc please tell​
expeople1 [14]

Blind Carbon Copy

For emails. It is used to send a copy of the email to somebody without the original person receiving it knowing that you sent a copy.

3 0
3 years ago
Read 2 more answers
A JOB LEADS SOURCE LIST is used to help record all of the job leads you can find. It includes contact information and a plan for
Amiraneli [1.4K]

Answer:t

Explanation:

8 0
2 years ago
Is a protocol that allows users to log on to and access a remote computer?
kompoz [17]
The answer is yes I hope this help ya out

6 0
3 years ago
What is NOT an issue associated with tag management systems? There is no automation available for tag management systems. Managi
SSSSS [86.1K]

Answer:

Managing tags means experience with the programming language to utilize them.

Explanation:

In different markets, tags are used to assigned prices and values to different products. To make these tags "tag management systems" are deployed to manage and create these tags.

Tag management system is software, that is used to create the tags with ease. There is no need of coding or programming while creating tags.

<em>So we can say that, There is no issue of Managing tags means experience with the programming language to utilize them.</em>

5 0
3 years ago
Other questions:
  • A(n) ____________________ or cryptosystem is an encryption method or process encompassing the algorithm, key(s) or cryptovariabl
    11·1 answer
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Describe the Software Development Life Cycle. Describe for each phase of the SDLC how it can be used to create software for an E
    14·1 answer
  • Create a program that will read in a Salesperson name, employment status (1=Full-time AND 2=Part-time) and the sales amount.
    5·1 answer
  • I have this assignment due TONIGHT BEFORE 10PM! Please help. 50 points for whoever will help!! Here is the assignment.
    7·1 answer
  • Which of the following statements is true?A)Implicit data type conversion is performed when you mix values of different data typ
    5·1 answer
  • What is ana absolute adress
    11·1 answer
  • Which picture should i put as my profile picture.
    15·2 answers
  • If the three operations were combined, O(logN) + O(N) * O(logN) + 1, the overall algorithm cost would be:________
    6·1 answer
  • Explain the correct ways of using keyboard. .​
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!