Answer:
#include <iostream>
using namespace std;
class ProblemSolution {
private:
int num1, num2;
public:
ProblemSolution(int n1, int n2) {
num1 = n1;
num2 = n2;
}
int calculateSum() {
int sum = 0;
sum = num1 + num2;
return sum;
}
void printSum() {
// calculateSum will return sum value that will be printed here
cout <<"Sum = "<< calculateSum();
}
~ProblemSolution() {
cout << "\nDestructor is called " << endl;
};
};
int main() {
int a, b;
cout << "Enter a: ";
cin >> a;
cout << "Enter b: ";
cin >> b;
// Initiallizing object pointer of type ProblemSolution
ProblemSolution *objPtr = new ProblemSolution(a,b);
// printing Sum
objPtr->printSum();
// delete objPtr to relaease heap memory :important
delete objPtr;
return 0;
}
Explanation:
we will initialize a pointer "objPtr" and initallize the constructor by passing 2 values a and b followed by the keyword "new". the keyword "new" allocates memory in the heap. we can access class member functions using arrow "->". it is important to delete objPtr at the end of the program so that the heap memory can be freed to avoid memory leakage problems.
Answer:
D. There were 176,400 samples of the orchestra music taken every second.
Explanation:
In Signal processing, whenever we convert a analog signal into Digital signal. We makes the sample of that audio signal. These samples are calculated using Nyquist Theorem. These are measured in the unit of samples per second which is called sampling rate. According to the Nyquist theorem, for better performance in digital signal, sampling rate should be double of the actual frequency of the signal in analog.
In given case 176,400 Hz is the sampling rate of the digital audio of the orchestra which means 176,400 samples per second.
The most extreme form of monoculture involves the cultivation of a single genotype of a crop species, to the exclusion of other genotypes and other species.
Answer:
Explanation:
A computer is a machine that can be programmed to accept data (input), process it into useful information (output), and store it away (in a secondary storage device) for safekeeping or later reuse. The processing of input to output is directed by the software but performed by the hardware.
Authentication verifies who the user is whilst Authorization determines what resources a user can access.