In Python 3, create a parent class named Machine and a child class named PollMachine. Have methods to clear the machine state, to agree or disagree with 3 polling questions of your choice, get tallies of all the agrees and disagrees for each answer, and display the results once the poll is ended (these methods can go in whichever class). Keep asking users to enter answers until the user ends the program. The program should use inheritance, so there should be a parent class and a child class.
OOPs
In today's technology-driven world, computer programming skills are in high demand. The object-oriented programming (OOP) approach is very much useful while designing and maintaining software programs. Object-oriented programming (OOP) is a basic programming paradigm that almost every developer has used at some stage in their career.
Constructor
The easiest way to think of a constructor in object-oriented programming (OOP) languages is:
In Python 3, create a parent class named Machine and a child class named PollMachine. Have methods to clear the machine state, to agree or disagree with 3 polling questions of your choice, get tallies of all the agrees and disagrees for each answer, and display the results once the poll is ended (these methods can go in whichever class). Keep asking users to enter answers until the user ends the program. The program should use inheritance, so there should be a parent class and a child class.
Trending now
This is a popular solution!
Step by step
Solved in 2 steps