223k views
3 votes
What is an attribute? Give an example of an entity with some attributes.

User Null
by
6.6k points

1 Answer

3 votes

Answer:

Definition and example

Step-by-step explanation:

An attribute defines a property of an object. Not only for an object but also it can be defined for any file or element. In other words we can say that an attribute of an object comprises of a name and a value of an element. Moreover it can be a type or class name of a file. An attribute example in C++ to apply a constraint is:

int g(int i)

{

if (i > 0)// applying constraint/defining attribute

return i;

else

return -1;

// Code

}

User Nathan Goings
by
5.1k points