Answer:
- #include <iostream>
- using namespace std;
- class myinteger {
-
- private:
- int value;
-
- public:
- myinteger(int x){
- value = x;
- }
-
- int getValue(){
- return value;
- }
-
- };
- int main()
- {
- myinteger obj(4);
- cout<< obj.getValue();
- return 0;
- }
Explanation:
Firstly, we use class keyword to create a class named myinteger (Line 5). Define a private scope data field named value in integer type (Line 7 - 8).
Next, we proceed to define a constructor (Line 11 - 13) and a getter method for value (Line 15 -17) in public scope. The constructor will accept one input x and set it to data field, x. The getter method will return the data field x whenever it is called.
We test our class by creating an object from the class (Line 23) by passing a number of 4 as argument. And when we use the object to call the getValue method, 4 will be printed as output.
The top one is C. I can't answer the others lol.
<u>DDT</u> as it's a pesticide that can harm people through suffocation.
Answer:
Domain integrity constraint and Entity integrity constraint
Explanation:
Data integrity constraints protect the quality of data by ensuring data doesn't lose its integrity, validity, or consistency when there is update to data. Data integrity constraints are rules applied to table columns in DBMS systems to prevent any unintentional damage to data. There are four types of data integrity constraints: domain integrity constraint, entity integrity constraint, referential integrity constraint, and key constraint.
Domain integrity constraint applies rules to protect against the values or attributes in the table column.
Entity integrity constraint applies rules to protect the uniqueness of rows in the table.