Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ Which defines the relationship between Bed and Burnable?a)interface b)inheri

ID: 3920306 • Letter: C

Question

c++

Which defines the relationship between  Bed and Burnable?a)interface b)inheritance c)property d)mammal

What is the difference between a method that extends the parent method and one that overrides it?

When designing classes, what is the concept of "cohesion" refer to?

Even though we could get our programs working without it, what is one good reason we want to use inheritance when designing our classes?

What would happen in a GUI program if you didn't write any listeners at all?

When I click a button, who gets notified about it.

What part of the program is the Model responsible for?

What part of the program is the View responsible for?

What part of the program is the Controller responsible for?

What is an example of a time the Model is allowed to directly change the View?

Explanation / Answer

1. Inheritance

2. Extending the parent method means the parent method is called and along with that
   more functionality is added.We call the parent method before or after the added
   functionality. In case of overriding we may change the complete processing of
   the parent method and will not utilize the functionality of parent method as it
   is (No calling of parent method). However in both the cases we are rewriting
   the parent method.

3. Cohesion refers all about how a single class is designed. Cohesion makes sure that a class is designed with a single, well-focused purpose.
   It gives a measure of how well the elements of class are getting interdependent or interrelated.
   The advantages of high cohesion is that such classes are much easier to maintain (and less frequently changed) than classes with low cohesion. Another benefit of    high cohesion is that classes with a well-focused purpose tend to be more reusable than other classes.
   Example : We have a class that adds two numbers, but the same class creates a pop up window displaying the result.
   This is the example of low cohesive class because the popup window and the addition operation don’t have much in common.
   To make it high cohesive, we would have to create a class Display and a class Addition.
   The Display will call Addition’s method to get the result and display it.This way to develop a high cohesive solution.

4. We can not interact with the GUI. It will be just a display of information.

5. The Controller gets notified on clicking button
6. Model represents the data part and business rules of the processing
7. View corresponds to elements of the user interface such as text, checkbox items, and so forth
8. Controller links the Model part(Data and business rules) and the view part (GUI, buttons, textboxes etc..).The controller handles user actions such as keystrokes      and mouse movements and pipes them into the model or view as required.
9. Generally the view gets updated based on the actions of controller (user actions), but there are times when display gets updated without any inetervention
   of user actions.A model notifies its associated view/views and controllers when there has been a change in its state. This notification allows views to update their    presentation, and the controllers to change the available set of commands. In some cases an MVC implementation might instead be "passive," so that other components    must poll the model for updates rather than being notified.Example the Model is dealing with some product database and whenever change in database happens, The
   model updateds its state based on some trigger and then in this case there is no role of controller, it just notifies to View which just didplays the updated
   information.
  

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote