
Concept explainers
Mark the following statements as true or false.
All members of a struct must be of different types. (1)
A struct is a definition, not a declaration. (1)
A struct variable must be declared after the struct definition. (1)
A struct member is accessed by using the operator :. (2)
The only allowable operations on a struct are assignment and member selection. (2)
Because a struct has a finite number of components, relational operations are allowed on a struct. (2)
Some aggregate input/output operations are allowed on a struct variable. (2)
A struct variable can be passed as a parameter either by value or by reference. (4)
A function cannot return a value of the type struct. (4)
An array can be a member of a struct. (6, 7)
A member of a struct can be another struct. (8)
a)

To find whether given statement is true or false.
False
Explanation of Solution
Given Information: All members of a struct must be of different types.
Explanation:In the C++ programming language, the struct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components. These components can be of different types. It means that a struct has both same type and different type component/members.
Conclusion:All Component/members of a struct can be of same types and can be of different types.Hence, the given statement is false.
b)

To find whether given statement is true or false.
true
Explanation of Solution
Given Information: Astruct is a definition, not a declaration.
Explanation:In the C++ programming language, struct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components of both same and different types.To use the struct, an instance/pointer/variable is declared and memory is allocated for the instance/pointer/variable of thestruct when they declared.
Conclusion: Astruct is used to define a structure. Hence, the given statement is true.
c)

To find whether given statement is true or false.
False.
Explanation of Solution
Given Information: A structvariable must be declared after the struct definition.
Explanation:In the C++ programming language, struct is a reserved keyword. This keyword is used to define a structure. To use the struct, an instance/pointer/variable is declared and memory is allocated for the instance/pointer/variableof the struct when they declared.
Conclusion: An instance/pointer/variable of the structcan be declared when required.
Hence, the given statement is false.
d)

To find whether given statement is true or false.
false
Explanation of Solution
Given Information: A structmember is accessed by using the operator (:).
Explanation:In the C++ programming language, the dot (.) operator is used to access the member of a struct. This operator is also known as member access operator.
Conclusion: Toaccess the member of a struct a member access operator (.) is used.
Hence, the given statement is false.
e)

To find whether given statement is true or false.
true
Explanation of Solution
Given Information: The only allowable operations on a struct are assignment and member selection.
Explanation:In the C++ programming language, Theassignment and member access operations are the two built in operations for astruct. The arithmetic and relational operations are not allowed on struct.
Conclusion: The assignment and member selectionoperations are the only allowableoperations on a struct.
Hence, the given statement is true.
f)

To find whether given statement is true or false.
false
Explanation of Solution
Given information: As a struct has a finite number of components, therefore, relational operations are allowed on a struct.
Explanation:In the C++ programming language, Thestruct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components. These components can be of different types. It means that a struct has both same type and different type component/members.The assignment and member access operations are the two built in operations for a struct. The arithmetic and relational operations are not allowed on struct.
Conclusion: The relational operations are not allowed on a struct.
Hence, the given statement is false.
g)

To find whether given statement is true or false.
False
Explanation of Solution
Given Information: Some aggregate input/output operations are allowed on a struct variable.
Explanation:In the C++ programming language, Thestruct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components. These components can be of different types. It means that a struct has both same type and different type component/members. The assignment and member access operations are the two built in operations for a struct. The arithmetic and relational or other aggregate input/output operations are not allowed on struct.
Conclusion: The aggregate input/output operations are not allowed on a struct.
Hence, the given statement is false.
h)

To find whether given statement is true or false.
True
Explanation of Solution
Given Information: A struct variable can be passed as a parameter either by value or by reference.
Explanation:In the C++ programming language, struct is a reserved keywordused to define a structureof fixed number of components of same or different types. Astruct can be passed as a parameter to a functioneither by value or by reference.
Conclusion: A struct variable can be passed as a parameterto a function either by value or by reference.
Hence, the given statement is true.
i)

To find whether given statement is true or false.
False
Explanation of Solution
Given Information: A function cannot return a value of the type struct.
Explanation:In the C++ programming language, struct is a reserved keyword used to define a structure of fixed number of components of same or different types. A struct can be passed as a parameter to a function either by value or by reference. A function can also return a value of structtype.
Conclusion: A function can return a value of struct type.
Hence, the given statement is false.
j)

To find whether given statement is true or false.
True
Explanation of Solution
Given Information: An array can be a member of a struct.
Explanation:In the C++ programming language, the struct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components/members. These components can be of different types. The component/member can be of array type, struct type, integer type, float type, char type, string type, char type, or Boolean type.
Conclusion:An array can be a member of a struct.
Hence, the given statement is true.
k)

To find whether given statement is true or false.
true
Explanation of Solution
Given Information: A member of a struct can be another struct.
Explanation:In the C++ programming language, the struct is a reserved keyword. This keyword is used to define a structure. A structure is a collection of fixed number of components/members. These components can be of different types. The component/member can be of array type, struct type, integer type, float type, char type, string type, char type, or Boolean type.
Conclusion: A struct can be a component/member of another struct.
Hence, the given statement is true.
Want to see more full solutions like this?
Chapter 9 Solutions
EBK C++ PROGRAMMING: FROM PROBLEM ANALY
- CSE330 Discrete Mathematics 1. In the classes, we discussed three forms of floating number representations as given below, (1) Standard/General Form, (2) Normalized Form, (3) Denormalized Form. 2. Let ẞ 2, m = 6, emin = -3 and emax = 3. Answer the following questions: Compute the minimum of |x| for General and Normalized form (a) Compute the Machine Epsilon value for the General and Denormalized form. If we change the value of emax to 6 then how will it affect the value of maximum scale invariant error for the case of Normalized form? Explain your answer. show answer in pen a Don't use any Al tool nd paper then take pi ctures and sendarrow_forwardCSE330: Discrete Mathematics 1. In the classes, we discussed three forms of floating number representations as given below, (1) Standard/General Form, (2) Normalized Form, (3) Denormalized Form. Now, let's take, ẞ = 2, m = 3, emin = -2 and emax = 3. Based on these, answer the following: (a) (b) (c) (d) What are the maximum/largest numbers that can be stored in the system by these three forms defined above? (express your answer in decimal values) What are the non-negative minimum/smallest numbers that can be stored in the system by the denormalized form? (express your answer in decimal values) How many numbers (both non-negative and negative) can be represented in the above mentioned system using the general form? Explain your answer. Find all the decimal numbers for e = 3 and e = 2 in denormalized form, plot them on a real line and prove that all the numbers are not equally spaced. Write the equally spaced sets for the number line you drew. show your answer in Don't use any Al tool pen…arrow_forward3.[20 pts] Find the minimum equivalent circuit for the one shown below (show your work): DAB 0 f(A,B,C,D)arrow_forward
- Suppose your computer is responding very slowly to information requests from the Internet. You observe that your network gateway shows high levels of network activity even though you have closed your e-mail client, Web browser, and all other programs that access the Internet. What types of malwares could cause such symptoms? What steps can you take to check whether malware has gained access to your system? What tools can you use at each step? If you identify malware, what ways might it have entered your system? How can you restore your PC to safe operation, including the special software tools you may use?arrow_forwardR languagearrow_forwardUsing R languagearrow_forward
- Compare the security services provided by a digital signature (DS) with those of a message authentication code (MAC). Assume that Oscar can observe all messages sent between Rina and Naseem. Oscar has no knowledge of any keys but the public one, in the case of DS. State whether DS and MAC protect against each attack and, if they do, how. The value auth(x) is computed with a DS or a MAC algorithm. In each scenario, assume the message M = x#####auth(x). (Message integrity) Rina has the textual data x = “Transfer $1000 to Mark” to send to Naseem. To ensure the integrity of the data, Rina generates auth(x), forms a message M, and then sends M in cleartext to Naseem. Oscar intercepts the message and replaces “Mark” with “Oscar.” Will Naseem detect this in the case of either DS or MAC? If yes, how will Naseem detect it? If not, why? (Replay) Rina has the textual data x = “Transfer $1000 to Mark” to send to Naseem. To ensure the integrity of the data, Rina generates auth(x), forms a message…arrow_forwardI need to resolve the following....You are trying to convince your boss that your company needs to invest in a license for MS-Project (project management software from Microsoft) before beginning a systems project. What arguments would you give her?arrow_forwardWhat are the four types of feasibility? what is the issues addressed by each feasibility component.arrow_forward
- I would like to get ab example of a situation where Agile Methods might be preferable versus the traditional SDLC? What are the characteristics of this situation that give Agile Methods an advantage?arrow_forwardWhat is a functional decomposition diagram? what is a good example of a high level task being broken down into tasks in at least two lower levels (three levels in all).arrow_forwardWhat are the advantages to using a Sytems Analysis and Design model like the SDLC vs. other approaches?arrow_forward
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,




