Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

c++ beginner level need expert answer to grade mine Ifazrayl and array2 are arra

ID: 3772834 • Letter: C

Question



c++ beginner level
need expert answer to grade mine

Ifazrayl and array2 are arrays of the same size and same type, to make arrayz a copy of arrayl: a. assign arrayl to array2, such as array2 arrayl; b. write a copy function that will make an element by element copy of arrayl 1. elements into array2 elements use the C++ copy function that is a part of the C++ language c. d. use the default constructor to create array2 with arrayl elements 2. Functions are commonly used to a. speed up the compilation of a program b. break a problem down into small manageable pieces c- emphasize certain parts of the logic d. document the program element within an ara a. subscript b. global unique identifier c. element d. argument 4. The expression static castedoubles (3) is called a a. Type cast b. nultiplier c. doubler d. polymorphism Overloading means multiple functions a. have the same name, but different return types b. have different names, but the same formal parameters c. have the same name, but different formal parameters d. perform the same function S. If you write a function that should use call-by-reference, but forget to include the ampersand, a. b. c. d. 6. The program will not compile The program will not link The program will not run without a run-time error The program will run with incorrect results 7. Which of the following is the correct way to close a file stream named outFile? a. outFile.close) b. outrile.close c. outFile.close("project.txt" d. close (outFile) If the user types in the characters 10, and your program reads them into an integer variable, what is the value stored into that integer? a. 1 8. c. d. 10 None of the answers are correct When the function below is called, theofthe actual parameters is passed to the function definition double sgrt (double value) ; a. name b, value 9. c. address d. scope Information Hiding is analogous to using a. an algorithmic design c. formal parameters d. actual parameters b. a black-box methodology

Explanation / Answer

1. Answer is (b)
We need to write a copy function that will make an element by element copy of array1 elements into array2 elements

2. Answer is (b)
Functions are commonly used to break a problem down into small manageable pieces

3. Answer is (a)
Subscript is the number used as an index to pinpoint a specific element within an array
if A is array then, in A[i], i is subscript and A[i] is element at index i

4. Answer is (a)
static_cast function is used to type cast a value
static_cast<double>(3) type casts 3 to double type

5. Answer is (c)
Overloading means multiple functions have the same name, but different formal parameters
Ex:
double area(int radius);
double area(int length, int breadth);
Nmae of the function is area in both cases but formal parameters differ

6. Answer is (d)
If a function should use call-by-reference, but forgot to include the ampersand, then the function becomes call-by-value and the program will run with incorrect results

7. Answer is (a)
outFile.close(); will close the filehandler holding by outFile object

8. Answer is (c)
When the program reads an integer from user, it reads all the chars till space or new line char encounters.
Since there is no space between 1 and 0, program reads both chars together and updates the integer variable with value 10.

9. Answer is (b)
When double sqrt(double value) is called, the value of the actual parameter is passed to the function since, the function is using call-by-value

10. Answer is (b)
Information Hiding is analogous to using a black-box mehodology
We can make use Hidden data through proper channels but can't access them directly

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote