Create a class definition based on the specifications provided below. Make sure you use the proper C++ syntax in defining your class. Specifications: 1. Class name is Area; 2. It has 2 fields namely...


Create a class definition based on the specifications provided below. Make sure<br>you use the proper C++ syntax in defining your class.<br>Specifications:<br>1. Class name is Area;<br>2. It has 2 fields namely n1 and n2, declared as integer.<br>3. The 2 fields must only be accessible within the class.<br>4. There is a constructor that is capable of accepting values for 1<br>field called x.<br>5. There is another constructor that is capable of accepting values<br>for 2 fileds called x and y;<br>6. Create the code inside the constructors. The codes will simply<br>assign value of x and y to n1 and n2, respectively.<br>7. Specify the appropriate access modifier for the constructors.<br>

Extracted text: Create a class definition based on the specifications provided below. Make sure you use the proper C++ syntax in defining your class. Specifications: 1. Class name is Area; 2. It has 2 fields namely n1 and n2, declared as integer. 3. The 2 fields must only be accessible within the class. 4. There is a constructor that is capable of accepting values for 1 field called x. 5. There is another constructor that is capable of accepting values for 2 fileds called x and y; 6. Create the code inside the constructors. The codes will simply assign value of x and y to n1 and n2, respectively. 7. Specify the appropriate access modifier for the constructors.

Jun 04, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions ยป

Submit New Assignment

Copy and Paste Your Assignment Here