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
What is the importance of different camera angles ?
Serga [27]

Answer:

the camera angle helps the Creator to establish different relationships between the subject and even between the audience and the subjects. it's very important to master these techniques if you want to become a pro filmmaker!

3 0
3 years ago
Read 2 more answers
Explain why the receptionist responded as indicated in the following scenario.
slavikrds [6]
The receptionist is aware of the every day attire as he works there. Jim and Roger are undressed, since they were wearing blue jeans. The receptionist lets them know of what’s expected.

Hope this helps!
4 0
2 years ago
. List 5 types of exploits from cybercrime and provide brief definition. (2.5 Marks)
Flura [38]

In cyber security, an exploit is a way attackers take advantage of certain vulnerabilities and gain malicious access to systems. There are very many types of exploits that exist in the cyber security world. However, I will mention those ones most commonly used.

DoS attacks – The denial of service attacks is very common. Hackers will gain access to servers and send so many packet requests at the same time. The servers become overwhelmed due to too much memory allocation and the huge amount of traffic ends up crashing the servers.

Unauthorized access – When an attacker has an illegal access to host machines

<u>Application Exploitation</u>

Code injection – This exploit can be used to maliciously inject invalid code into an application program or software and as a result change how the program behaves.

Cross-site scripting – Enable hackers inject malicious scripts on a website of a client. Once they have gained access, they will escalate their privileges and have more access to the site.

Clickjacking – A type of attack that tricks unknown victims into clicking links of a web page they believe are legitimate and end up revealing confidential information of themselves.

6 0
4 years ago
A form of Internet identity theft involving phony e-mail messages asking customers to update their credit card numbers, account
irina [24]

Answer: Phishing

Explanation:

Phishing is a form of identity theft involving phony email messages asking customers to update credit, debit, cards, accounts passwords, and all whole of personal information. It is still one of the relevant form of identity theft whereby personal information is taken away in form of electronic communication or messages.

One example could be when a person receives a mail from xyz.com and ask him/her to click on a page. upon clicking on it the person will be redirected to another page. in that page several details would be there such as username and password, bank account details. So once all these details are entered in the web page all our personnel information will leaked into the servers of the hackers and could lead to serious troubles. Sometimes phishing is also in form of fake social networking website which resembles exactly to that of the original one.

So Phishing is a for of identity theft.

3 0
3 years ago
Identify the hardware components in your own computer. If you don't have a computer, use a friend's, or one at work or in an NVC
sergij07 [2.7K]

Solution :

A friend of mine have an old version of computer PC having the following components :

Input devices

Model name of the keyboard -- PUNTA , model number -- P-KB515

Model name of the mouse -- PUNTA, model number -- P-KB515

Output devices

Speaker : COMPAQ

Monitor : ACER,  Model Number  --- EB192Q

Storage : 500 MB capacity hard disk

RAM : 2 GB

Processor : Intel Pentium dual E1260 at the rate 1.80 GHz

It is provided with audio jacks

5 0
3 years ago
Other questions:
  • True or false words spelling and grammar check is always %100
    7·2 answers
  • When selecting text in word, holding down the ctrl key while clicking the mouse button will select the?
    15·1 answer
  • This type of peripheral is used to interact with, or send data to, the computer.
    12·2 answers
  • A computer program that senses when another computer is attempting to scan or access a computer or network is called an
    7·1 answer
  • An sObject named Application _c has a lookup relationship to another sObject named Position_c.
    12·1 answer
  • Does anybody know if that apple watch is actually worth what it costs?
    9·2 answers
  • What type of Internet monitoring technique records information about a customer during a web surfing session, such as what websi
    8·1 answer
  • Select the correct answer.
    13·1 answer
  • How many countries don't uses the metric system?​
    12·2 answers
  • Write a function that dynamically allocates an array of integers. The function should accept an integer argument indicating the
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!