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

1. Any mathematical operations that can be performed on regular C++ variables ca

ID: 3546055 • Letter: 1

Question

1.  Any mathematical operations that can be performed on regular C++ variables can be performed on structure members.


2.  The structure pointer operator is used to dereference a pointer to a structure, not a pointer that is a member of a structure.


3.  Structure variables may be passed as arguments to functions.


4.  A struct can contain members with varying data types.


5.  You can define any number of union variables, but each variable can only store the value of one member at a time.


6.  It is possible for a structure variable to be a member of another structure variable.


7.  If a function is legally prototyped to return an integer value, it can return a structure member that is an integer data type.


8.  It is possible for a structure to contain as a member a pointer to its own structure type.


9.  When a programmer creates an abstract data type, he or she can decide what values are acceptable for the data type, as well as what operations may be performed on the data type.


10.  It is possible to output the contents of all members of a structure variable using a cout << statement followed by the name of the structure variable.


11.  Look at the following structure declaration.

struct Circle

{

     double centerx;

     double centery;

     double radius;

};


Assume that circle1 and circle2 are variables of the Circle type, and their members have been initialized. Is it true or false that the following if statement correctly determines whether the two variables' members contain the same data:

if (circle1 == circle2)


12.  A function cannot modify the members of a structure.

Explanation / Answer

1. true

2. true

3 true

4. true

5. true

6. true

7. true

8. true

9. true

10. true