Reference no: EM13693217
Question 1: Consider the subsequent statement:
int *num;
Program 1) Write the C++ statement that dynamically creates an array of 10 components of type int and num contains the base address of the array
Program 2) Write the C++ code that inputs data into the array num from the standard input device
Program 3) Write the C++ statement that de-allocates the memory space of array to which num points
Question 2: Write the copy-array procedure by a function
int main()
{
int *a, *b;
int lena, lenb;
cout << "Enter the length of a: ";
cin >> lena;
a = new int[lena];
// Assume some values are loaded in a.
b = CopyArray(a, lena, lenb); // WRITE THIS FUNCTION!!
// After the function, 'b' is a copy of 'a' and
// 'blen' represents the length of 'b'
}
===================================================
Question 3:
Write the function: void shuffle(int ar[], int size);
This function "shuffles" the elements in the array pointed by 'ar' (and whose length is 'size'). To do so, you randomly choose TWO indices (NOT ONE) and swap the elements.
Can you write these programs in C++ language? Define every function.
Write the function - void shuffle
: Write the function: void shuffle(int ar[], int size); This function "shuffles" the elements in the array pointed by 'ar' (and whose length is 'size').
|
Write a net ionic equation that accounts for the ph
: Problem- A .10 M solution of socium cyanide gives a pH reading of 11.1. Write a net ionic equation that accounts for this pH and calculate the approximate concentrations of CN-, HCN, and OH- in the solution and the value of Ka for HCN.
|
Determine the potential energy due to the long-range
: Problem- Determine the potential energy (eV) due to the long-range dipole-dipole interaction for two polar molecules with dipole moments of 1.0 D at room temperature with an internuclear separation of 500 pm. Contrast this energy with the energy o..
|
What is the pka of the indicator
: Problem- A certain indicator, HA, has a Ka value of 0.000016 M. The protonated form of the indicator is yellow and the ionized form is blue. 1. What is the pKa of the indicator
|
Write the copy-array procedure by a function
: Write the C++ statement that dynamically creates an array of 10 components of type int and num contains the base address of the array
|
Calculate the weight percent nh3 in the aqueous waste
: A 11.655 g aliquot of this solution is then titrated with 0.1079 M HCl. It required 30.25 mL of the HCl solution to reach the methyl red endpoint. Calculate the weight percent NH3 in the aqueous waste.
|
What is the value of qrxn in kilojoules
: Problem- Two 50.0 mL solutions at 289.6K are mixed and the temperature increases to 335.4K. What is the value of qrxn in kilojoules. Density = 1.00 g/mL, C = 4.18 J/gK Make sure your sign is correct.
|
Oxidize the silver metal in an ore sample to convert
: Problem- Which one of the following reagents could you use to oxidize the silver metal in an ore sample to convert it to Ag+ to get it into aqueous solution. You may assume that all species are at standard concentrations.
|
What hydrogen ion concentration should be required
: Problem- What hydrogen ion concentration should be required to dissolve 0.10 M MgF2 if the Ksp for magnesium flouride is 6.8*10^-9and Ka for HF is 6.5*10^-4
|