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

1)true false and 2)correct the errors Part 1: 1) True or False questions a. A C+

ID: 3571202 • Letter: 1

Question


1)true false
and
2)correct the errors

Part 1: 1) True or False questions a. A C++ program may contains two more main functions as needed? b. We can declare arrays with different data type elements? c. we declare int a171 and try to access a[8] there will be no compiled error? d. void functions are functions that return always a 0? e. If the number of iterations in a loop is unknown, you can use the for loop? allow aggregate operations on an array (ex array array2) f. C++ 2) The faulty program below is supposed to read in a phrase and output the phrase in reverse order. There are 3 errors in the code below. Correct the errors by referencing the line numbers along the left side include

Explanation / Answer

Part 1:

(a) A C++ program may contains two more main functions as needed? - True ( In some cases you can use it )

(b) we can declare arrays with different data type elements? - False ( Arrays are collection of similar data types)

(c) If we declare int a[7] and try to access a[8] there will be no compiled error? - False (compilation error occurs)

(d) Void functions are functions that returns always a 0? - False ( void function do not return any value)

(e) If the number of iterations in a loop is unknown, you can use the for loop. - True (for loops are used when the number of iterations are known before.)

(f) C++ allow aggregate operations on an array(ex: array1 = array2) - False (C++ does not allow aggregate operations on an array)

Part 2:

There are no errors and the program compiles successfully.