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]
3 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]3 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
User defined blocks of code can be created in
lys-0071 [83]
D....................
8 0
3 years ago
Amanda a recently moved into a new home. Everyone has their own tablet, and wants to connect to the same network, no matter wher
vagabundo [1.1K]

Answer:

wifi is the best network for all, As it gets in all corners of the house.

7 0
3 years ago
(03.05 LC
Trava [24]

Answer:

B. both primary and secondary sources.

Explanation:

Information can be defined as processed data that can be used to perform specific tasks or job functions. The two (2) main sources of information are;

I. Primary source: this type of source comprises of raw information that are first-hand in nature i.e a personal experience or witness of an event (occurrence).

II. Secondary source: this type of source relies solely on the primary source for its information and as such it comprises of second-hand information provided by other authors or researchers.

A reliable source is an information source that is unbiased, trustworthy and reliable. Also, a reliable source is typically backed up by evidence from various information channels and should be accurate.

In order to validate a reliable source, it is necessary that the information provided is checked against other credible sources to verify its accuracy.

This simply means that, if you got an information (data) from any source such as newspaper, website, television, books, radio or anywhere else, you should confirm the credibility and reliability of these information by verifying from one or more sources listed in the reference.

Hence, a reliable textbook should contain references to both primary and secondary sources.

Additionally, references are citations or links to all of the sources from which an author, writer, or researcher got his or her information from. One important thing that references show a reader is that the information is well researched.

4 0
3 years ago
Which command can be used to remove the test dpm package, including any test configuration files?
sesenic [268]
The apt-get remove test  command can be used to remove the test <span>Debian package management (</span>dpm) package, including any test configuration files.  
6 0
4 years ago
Why might your digital footprint be important when you are applying for collage
lyudmila [28]
The college boards like to do there research and check up on there students. So whether it be your facebook page or instagram, twitter etc... they see what you have been up to. <span />
3 0
3 years ago
Read 2 more answers
Other questions:
  • A database with a(n) _______________ data structure can easily handle a many-to-many data relationship. hierarchical network rel
    5·1 answer
  • How do you scan a qr code on your iPhone
    5·2 answers
  • Java and C++ are examples of _____.assembly languagehigh-level languagesmachine languagecompiler languages
    7·2 answers
  • Naruto Uzumaki who likes naruto ??? who waches it??
    14·2 answers
  • You open a link in a new tab by holding the _______ button while clicking the link
    8·1 answer
  • To use the mail merge feature in Access, the first step is to start the Microsoft Word Mail Merge Wizard.
    11·1 answer
  • ___________is a standard for exchanging structured data over the web. It allows creating documents consisting of customized tags
    11·1 answer
  • Split the worksheet into panes at cell G1.
    5·1 answer
  • Question Mode Matching Question Match the following description with the appropriate programming language generation. 1GL 1GL dr
    7·1 answer
  • Select all that apply.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!