Answer:
Encapsulation:-It is the binding of the data and functions so that they works as one unit.
Inheritance:-When one class acquires the property of another class it is called inheritance.
Polymorphism :-It generally means more than one form
Explanation:
Encapsulation:- class is an example of encapsulation it can hold different data types and functions in a single container called class.
class Name{
public:
string first_name;
string last_name;
void Display()
{
cout<<first_name<<" "<<last_name<<endl;
}
};
Inheritance:-The property of a class acquiring the properties of another class is called inheritance.
Now we will inherit the above defined class.
class person: public Name
{
public:
char gender;
int age;
void Display()
{
cout<<first_name<<" "<<last_name<<gender<<age<<endl;
}
};
int main()
{
Name n;
person p;
n.Display();
p.Display();
}
Polymorphism- There are two types of polymorphism:-
1.Run time polymorphism=The values are decided at run time.
2.Compile time polymorphism=The values are decided at compile time.
Example:-In the above example we have function Display() in both the classes.This is an example of compile-time polymorphism. We are deciding at the time of compilation which display to use.
are you using windows? linux? mac?
Answer:
Radiation from the screens will damage your brain and kill brain cells.
The lights dry out your eyes and you blink a lot more.
Explanation:
Answer:
The solution code is written in Python 3
- firstStr = input("Enter first string: ")
- secondStr = input("Enter second string: ")
-
- if(firstStr < secondStr):
- print("The first string comes first alphabetically.")
- elif(firstStr > secondStr):
- print("The second string comes first alphabetically.")
- else:
- print("The first and second string are same")
Explanation:
Firstly, prompt the user to input two strings (Line 1 - 2).
Next create if else if statement to check if the firstStr is less than, greater than or equal to the secondStr and then print the appropriate message accordingly (Line 4- 9). For example, the program display message "The first string comes first alphabetically." if it find the firstStr is less than secondStr.
Answer:
C
data mining
Explanation:
they are seeing what you are interested in and creating personalized adds