Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

first activity #4

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

first activity #4

wants to merge 2 commits into from

Conversation

baig13
Copy link

@baig13 baig13 commented Nov 8, 2023

Answered a question "difference between abstraction and encapsulation" examples using css.

Copy link
Owner

@saadali18 saadali18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR looks good
Suggestions:

  1. Change file extension to .cpp instead of .txt
  2. Change file name to question_1_another_example.cpp instead of first-activity.txt

Basic/first-activity.txt Outdated Show resolved Hide resolved
Basic/first-activity.txt Outdated Show resolved Hide resolved
@baig13
Copy link
Author

baig13 commented Nov 9, 2023

I have made the suggested changes

Copy link
Owner

@saadali18 saadali18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor enhancement Required

Comment on lines +1 to +7
Question: Difference between encapsulation and abstraction ?


Answer:

Encapsulation:
Encapsulation is about bundling data (attributes) and methods (functions) together, and restricting access to certain parts of the object. This helps in hiding the internal details and providing a clean interface for interacting with the object.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper comment syntax

Comment on lines +10 to +11
#include <iostream>
using namespace std;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Move it at the top of file

}


The concept of abstraction only shows necessary information to the users. It reduces the complexity of the program by hiding the implementation complexities of programs.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use proper comment syntax

Comment on lines +66 to +68



Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unnecessary extra lines

Copy link
Owner

@saadali18 saadali18 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few changes are still left, like proper comment syntax in cpp file
Moving libraries at the top of file
Removing extra spaces from the bottom of file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants