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

5. The area under a curve (representing a calculus integral) can be approximated

ID: 3908736 • Letter: 5

Question

5. The area under a curve (representing a calculus integral) can be approximated by using a for loop and taking the sum of the areas of small rectangles under the curve and examining the limit as the width of the rectangles (x) approaches zero a. TRUE b, FALSE 6.A function named function1() has two input parameters that of type double and returns an int. Select the corresponding function prototype below a. double, double function(int): b. double function1(int, int c. int function1(double, double): 7. A function named function20 has no return type (i.e., return type is void) and in input type of int. Select the appropriate call to this function below: b function2(3); 8. In general, a function prototype should come before main) while the function itself should come after main) a TRUE b. FALSE 9. #denne is an example of a. declaration b. preprocessor directive 10, Because of local scope (i.e., local scope of a variable), it is okay to have variables with the same name in two different functions: a. TRUE b. FALSE Short Answer (10 questions@ 2 points each): 1. Which function compares two strings? 2. Which

Explanation / Answer

Q5. TRUE using a for loop and taking the sum of small rectangles under the curve and examining the limit as width of rectangle approaches zero, we can get total area. another way is using trapezoidal rule.

Q6. C. int function1(double,double) is the correct declaration for given constraints for function1.

Q7. b. function2(3) is correct call to function as function2 has return type void.

Q8. TRUE as function prototype should be included in header files (before calling main) and function itself should come after main() because te first function that is executed in any program must be main().

Q9. #define is an example of PREPOCESSOR directive as it is processed before compiling the program.

Q10. TRUE, since local variables are confined to a definite scope and we can declare same name variable in two different functions

Short Answers

Q1. strcmp function is used to compare two strings. Syntax strcmp( constant *char s1, constant *char s2) return true if two strings are same and 0 otherwise.

Q2. strcat   function is used to concatenate two or more strings in C

Q3. Nested loop

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