Question
3. Answer the following questions about functions and arrays: (a) When passing arguments to a function, what is pass-by-value? What is pass-by reference? (b) What
3. Answer the following questions about functions and arrays:
(a) When passing arguments to a function, what is pass-by-value? What is pass-by reference?
(b) What is the difference between passing the values of variables of primitive data types and passing arrays to a function?
(c) How do you prevent the array from being modified accidentally in a function
when this array is passed to the function as an argument?
(d) What is the array index type? What is the range of the index for an array declared by the statement int list[10]?
(e) Can we change the capacity of an array after this array is declared? Does the
compiler show us error messages or warning if we use an index which is out of
the range to access an element of array?
4. Answer the following questions about classes:
(a) What is the interface of a class? What is the implementation of a class?
(b) What is a mutator function? What is an accessor function?
(c) What is a default constructor? What is the consequence if a class does not have a
default constructor?
(d) What is constructor overload?
(e) What is data field encapsulation? Why is it useful?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started