Reference no: EM13694459
Give the answer of given question and also give details.
Question 1: What are the main conceptual differences between object-oriented programming and the other programming techniques?
Question 2: What is the definition of reference variable? What are the differences between pass-by-value and pass-by-reference?
Question 3: What is memory leakage? Given an example and explain why it causes memory leakage (8 points).
Question 4: What is wrong with the following code? How to fix it? If there is nothing wrong, say "Nothing is wrong" (8 points).
int *p; // Line 1
int *q; // Line 2
p = new int [6]; // Line 3
*p = 1; // Line 4
for (int i = 1; i < 6; i ++) // Line 5
{
p[i] = p[i-1] + i; // Line 6
}
q = p; // Line 7
delete [ ]p; // Line 8
for (int j = 0; j < 6; j++) // Line 9
cout << q[j] << endl; // Line 10
Question 5. What is the output of the following program fragment:
void add_value(int *x, int &y, int z);
{
*x += 10;
y += 10;
z += 10;
}
int main (void){
int a = 5, b = 10, c = 11;
add_value(&a,b,c);
cout << a <<","<< b << ","<< c << endl;
return 0;
}
Output:
Describe each and every question in depth with examples.
Left to right across the first transition series
: Question- Proceeding from left to right across the first transition series (Sc to Zn), which of the following occurs
|
What is the purpose of a database driver
: what is the purpose of a database driver in terms of what it connects and What are some other examples of Database Drivers out there for the J2EE and .NET Platforms?
|
Offer an example of a query
: Can we offer an example of a Query in which we can use a parentheses to affect the order of execution in which the WHERE Clause has both AND and OR Logical Operators?
|
What is the maximum number of distinct emission spectral
: Question- Hydrogen atoms are excited by a laser to the n = 4 state and then allowed to emit. What is the maximum number of distinct emission spectral lines (lines of different wavelengths) that can be observed from this system
|
What is memory leakage
: What are the main conceptual differences between object-oriented programming and the other programming techniques and what is the definition of reference variable? What are the differences between pass-by-value and pass-by-reference?
|
Calculate the wavelength in nanometers
: Question- Calculate the wavelength, in nanometers, of the spectral line produced when an electron in a hydrogen atom undergoes the transition from the energy level n = 2 to the level n = 1.
|
Which wan technology increases the data capacity
: Which WAN technology increases the data capacity of fiber optic networks such as SONET and SDM by assigning incoming optical signals to specific frequencies of light (wavelengths) within a frequency band?
|
Calculate the wavelength of the 4 1 transition
: Question- Hydrogen atoms are excited by a laser to the n = 4 state and then allowed to emit. What is the maximum number of distinct emission spectral lines (lines of different wavelengths) that can be observed from this system. Calculate the wavel..
|
What was the level of radioactivity of the nuclide
: Question- A sample of drinking water collected from a suburban Boston municipal water system in 2002 contained 0.52 pCi/L of radon. Assume that this level of radioactivity was due to the decay of 222 Rn (half-life = 3.8 days)
|