Question:
Questions for Programing :) thanks need 4 moreee?
?
2011-01-28 11:46:20 UTC
1) A constructor for a structure
a.must use default values to initialize the data members when a new structure variable is created.
b.must have parameters that receive values to initialize the data members when a new structure variable is created.
c.must have the same name as the structure tag.
d.must return a value.
e.is not required to do any of these.


2) Members of ________ unions have names, but these unions themselves have no name.
a.anonymous
b.referenced
c.organized
d.declared
e.all

3)In a procedural program, you typically have ________ stored in a collection of variables, and a set of ________ that perform operations on them.
a.numbers, arguments
b.parameters, arguments
c.strings, operators
d.operands, operators
e.data, functions

4)________ are sometimes called get functions and ________ are sometimes called set functions.
a.Accessors, mutators
b.Mutators, accessors
c.Public functions, private functions
d.Private functions, public functions
e.Value-returning functions, void functions
Three answers:
2011-02-01 10:15:59 UTC
1 - C or E: depends on why you are asking. [explained below]

No to a because, structure variables can be null or left with machine determined default values, a constructor is not required to set these values.

No to b because, constructors do not have to take parameters, in fact default constructors do not accept any arguments, and again as stated above a constructor is not obligated to initialise variables.

c - discussed below

No to d because constructors cannot return values, they cannot have return types specified as they are used to build the structure and that in itself is what is returned

e - discussed below



In an Academic context and from a point of view of an exam you should write C as that is what would be considered the right answer by an examiner but technically this is wrong. In order to prove why this is wrong would require an explanation which in a multiple choice exam wouldn't be possible really and would likely be ignored. So if this is school work then write C.



The answer is technically E. Structures can be anonymous, and in the case of an anonymous structure the constructor would not actually be named and therefore would not match any defined tag, so technically C is not entirely true because a Structure does not have to "have the same name as the structure tag" as structures can be created without a tag as in anonymous structures.





2 - A. Members of anonymous unions have names, but these unions themselves have no name.

- Unions can be named or anonymous, members must be named.



3 - E. In a procedural program, you typically have data stored in a collection of variables, and a set of functions that perform operations on them.



4 - A. Accessors are sometimes called get functions and mutators are sometimes called set functions.
Brandon
2011-01-28 12:00:50 UTC
1-A, 3-E, 4-A. These 3 I am sure of. I've taken many programming courses from high school through college but #3 I have no clue on, I couldn't even guess. Maybe someone else knows that one.
straathof
2017-01-21 16:53:18 UTC
----a million. might you hear to an atheist radio application? (Or, consistent with threat you already do?) i might. i've got tried listening to some podcasts yet lost activity because of the fact it wasn't very exciting. i'm going to have study it in much less time. ----2. What might you be maximum attracted to listening to / listening to approximately? (visitor audio gadget, information re: events, song, and so on?) i admire listening to approximately something if this is supplied in an exciting and informative way. modern-day political events, philosophy, and literature that relate to atheism activity me. Ridiculing faith could properly be redundant, so consistent with threat decrease that to a Friday humor style of element, in case you do it in any respect. ----3. Do you sense that such a prepare could desire to be syndicated? In different words, do you think of there is sufficient purpose industry? i think of it would probable paintings properly as a podcast. it would possibly on no account air the place I stay (U.S. Bible Belt). possibly it would stay to tell the tale in extra suitable cities, yet i do no longer quite understand something approximately no count if or no longer courses might stay to tell the tale.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...