1. What is Procedural Programming? What is Object Oriented Programming? What are the advantages of using Object Oriented Programming?
Procedural Programming is a type of programming paradigm that uses step-by-step procedures to produce an output.
Object-Oriented Programming is another type of programming paradigm that hires a concept of “object.” Just like every object in real world has elements that construct itself, objects in Object-Oriented Programming contains data, or attributes. These objects also have “methods” which are actions that an object can perform.
One of the greatest advantages that OOP has is the code reuse. As we objectify elements, we can easily reuse objects that have been made before in other projects. Encapsulation is what allows this code reuse. As programmers create objects, they hide the core
of XXX XXXX implementation so others can use XXXX without XXXXXXX how XXXX work XXXXXXXXX. Another XXXXXXXXX of OOP is that programmers can XXXXXX a program XXXX a number of XXXXXXX. XXXX XXXXX easier to XXXX XXX coding process.
Sources
XXXXX://XXX.cs.XXXXXX.edu/~XXXXXXX/Fa15/notes/06.XXXXX/XXXXXXXXXX.html?XXXXXXXXXXXX=X
XXXXX://www.techopedia.com/XXXXXXXXXX/8982/procedural-language
https://en.wikipedia.org/XXXX/XXXXXX-oriented_programming
X. XX Python, how is a XXXXX defined? What are usually the X XXXX sections XX a XXXXX? Give an XXXXXXX.
In XXXXXX, a XXXXX is defined in XXXX XXXXXX:
class XXXXXXXXXXXXX:
<XXXXXXXXX&XX;
<XXXXXXXXX&XX;
…
XXX two XXXX XXXXXXXX XX a class are XXXXXXXXX XXX XXXXXX. Attributes XXX the main body XXXXXXXX that make XX an object. Methods are actions XXXX an object perform to XXXXXX its XXXXXXXXXX or use XXXXXXXXXX XX produce an XXXXXX. For example, XXX’s XXX we have a XXX as a class. XX order to XXXX something a “car,” it should XXXX XXX XXXXXXXX that XXXX it a car, such XX an engine, doors and wheels: these are XXXXXXXXXX. What XX XX do XXXX a XXX? We XXXXX it XX move from a place to XXXXXXX: this XX a method. A car XXXXXXXX XXX to XXXX XXX XXXXXX XX XXXX: combination XX XXXXXXXXXX XXX XXXXXXX.
XXXXXX -XXXXX://docs.XXXXXX.org/3/XXXXXXXX/XXXXXXX.XXXX
3.XXXX is the XXXXXXXXXXXX between an object and XXX defining XXXXX? How do you XXXXXX an XXXXXX in XXXXXX? XXXX an Example.
An object XXX XXX XXXXXXXX class have a very XXXXX relationship. There XXX’t XX an XXXXXX without XXX XXXXXXXX XXXXX. A class is like a recipe for an XXXXXX. X certain XXXXXX XXXX XXXX XXXXX XXXXXXX in XXXXXXXXXXXXX class in order XX XX an XXXXXX. XX create an object in Python, you XXXX to instantiate a class XXXXX a XXXXXXXX notation XXXX the XXXX of a XXXXX.
For example, let’s XXX we XXXX a class named “XXXXXXX”. XX we XXX going to XXXX a XXXXXXXX x to XXXX an XXXXXX of MyClass, XX XXXXXX write XXXX like XXXX:
x = XXXXXXX()
XX there’s a XXXXXXXXXXX of XXXXXXX XXXX XXXXX XXXXXXXXX, code should XXXX XXXX XXXX:
x = MyClass( arg1, arg2 ) &XX;- (two arguments XXX XXXXXXX)
source -https://XXXX.XXXXXX.XXX/X/XXXXXXXX/classes.XXXX#XXXXX-objects
4.XXXXXXX are XXXXXXX XXXXXXXXX XX using UML diagrams. Describe what an UML diagram is and give an XXXXXXX.
UML XXXXXX for XXXXXXX Modeling XXXXXXXX. It is XXXX to XXXXXXXX XXXXXXX XXXXXXX and XXXXXXXXXXXX between XXXX XXXXXXXX to XXXX it XXXXXX to XXXXXXXXX. UML diagram XXX a XXXXX XXXXX XXXXX XXXXXXXX: Association, XXXXXXXXXXX, XXX XXXXXXXXXXX. First, it XXXXX relationships between XXXXXXX and how XXX XXXXX perform functions XXXX other classes with XXX methods and XXXXXXXXXX. XXXXXX, similar to association, it shows classes XXXX inherit XXXXXXXX of XXXXX XXXXXX XXXXX( base class ). XXXXXXX, it shows XXX XXXXXXX XXXXXX of the XXXXXXXX object-XXXXXXXX XXXXXXX. XXX image below XX an XXXXXXX of UML diagram model XX Customer XXX Order XXXXXXX. XX shows XXXX how the XXX XXXXXXX XXX related XXX their XXXXXXXXXX are defined.Images Not Shown
XXXXXX -XXXXX://XXX.visual-paradigm.XXX/guide/XXX-XXXXXXX-modeling-language/XXXX-is-XXX/
X.Classes XXXXXXX XXXX a “constructor” XXXXXX. Describe XXXX a “XXXXXXXXXXX” XX XXX XXXXXXXX XXX importance.
A constructor of a class XX XXXX a rule to XXXXXX XXXX XX create an object. XXXXXXXXXXX, a constructor XX a method of a class. It XX XXXX XXXX we instantiate an object. Objects are created using constructors defined in a XXXXX. There can XX XXXX than XXX XXXXXXXXXXX with XXXXXXXXX XXXXXX of arguments. Constructors are XXXXXXXXX and essential for a class because XXXX are XXXX a guide to XXXXXX an XXXXXX. XXXXXXX XXXXXXXXXXXX, it XX XXXXXXXXXX XX XXXXXX instances of a class in a XXX that programmers XXXX them XX be created. XXXXX XXXXX should XXXX a XXXXXXXXXXX XXXX though it XXXX has a XXXXXXX one XX clarify how an object is XXXXXXX.
XXXXXX -XXXXX://XXX.XXXXXXX.com/XXXXXXXXXXX/python/how-to-XXXXXX-a-constructor-in-XXXXXX/
6.When XXXXXXXX a XXXXX, sometimes a XXXX program is written. XXXXXXXX XXX XXXXXXXXXX XX XXXXXX a XXXX program and explain some XXXXXXXXXXXXXX XXXX XXXX be made XXXX testing a Class.
A test XXXXXXX XX critical XX every XXXXXXX. No XXX should XXXXXX a program before it’s XXX XX a XXXX XXXXXXX XXX checked XXXX XXXXXXXXXX XX XXXXXXX without any XXXXXXXXX XXXXXX. XXXXXX a test XXXXXXX XX a way to XXXXXXXX bugs that XXXXX be found in a real use of XXX XXXXXXX.
One XXX consideration that must be made XXXX XXXXXXX a class XX XXXX XXX programmer XXXXXX XXXXX XX XXXXXXX cases XXXX XXXX a XXXXXXX XXXX XX use XX XXX program when they test a XXXXXXX. This XX because XXXX are XXXXX XXXX often XXXX a XXXXXXX is used in a XXX it’s not XXXXXXXX XX or XXXXXXXXXXX XX be used.
">