Complete the code to declare a function that adds two integers.
int add(int a, int b) {
return a [1] b;
}The plus sign + adds two numbers together.
Complete the code to define a struct named Point with two integer members x and y.
struct [1] {
int x;
int y;
};The struct is named Point to represent a point with x and y coordinates.
Fix the error in the class method declaration to make it a constructor.
class Rectangle { public: int width, height; [1](int w, int h) { width = w; height = h; } };
A constructor has the same name as the class and no return type.
Fill both blanks to complete the procedural function that calculates area and the OOP method that returns area.
int calculateArea(int [1], int [2]) { return [1] * [2]; } class Rectangle { public: int width, height; int area() { return width * height; } };
The procedural function uses parameters width and height. The class uses member variables with the same names.
Fill all three blanks to complete the OOP class with constructor and method to calculate area.
class Circle { public: double [1]; Circle(double [2]) { [1] = [2]; } double area() { return 3.14159 * [1] * [1]; } };
The member variable is radius. The constructor parameter is r. The assignment sets radius = r.