Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please help me by answering the following questions. Thanks! Question 5 0.5 pts Which of the following can use a member initializer list? O Object

Please help me by answering the following questions. Thanks!

image text in transcribed

image text in transcribed

image text in transcribed

image text in transcribed

Question 5 0.5 pts Which of the following can use a member initializer list? O Object Get function Constructor O Set function Question 6 0.5 pts Which of the following can be used to initialize an object when it is declared in an application program? Public Member Function Public Constructor O Private Constructor O Private Member Function 0.5 pts Question 7 Suppose a program has the following House class (implementation details are omitted): class House { int num_of_bedrooms; House(; House(int b); void set_num_of_bedrooms(int b); int get_num_of_bedrooms(; }; And for each House object that is created, it needs to be guaranteed that the num_of_bedrooms is at least 1. In other words, input validation logic is needed to make sure that num_of_bedrooms is always at least 1. If code in the application program (i.e., in main) attempts to set num_of_bedrooms to less than 1, the input validation logic will detect this and simply set num_of_bedrooms to 1, and display an error message to the user that the number of bedrooms must be at least 1. Where the House class would it be appropriate to place this input validation logic? House(int b) House void set num_of_bedrooms(int b) int get_num_of_bedrooms Question 8 0.5 pts What is the relationship between throw, try, and catch? O Throw handles an exception Try contains code that could possibly cause an exception Catch signals that an exception has occurred Throw signals that an exception has occurred Try contains code that could possibly cause an exception Catch handles an exception Throw handles an exception Try signals that an exception has occurred Catch contains code that could possibly cause an exception Throw signals that an exception has occurred Try handles an exception Catch contains code that could possibly cause an exception Question 9 0.5 pts The size of an object depends on the amount of memory required to store the class's what? O All of the above O Functions O Constructors O Variables Question 10 0.5 pts Suppose there is a class named Computer, which can be used to create objects that store information about a particular computer. This class is developed by the class developer. A different person, the application developer, needs to use the Computer class in their application. However, as described above, the application developer did NOT develop the class - they are just using it. The application code is in a file named Main.cpp. In this scenario, the application developer would normally have access to all of the following files EXCEPT: Computer.cpp Computer.h Main.exe Main.obj

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Database Systems Design Implementation And Project Management

Authors: Albert K.W. Yeung, G. Brent Hall

1st Edition

1402053932, 978-1402053931

More Books

Students also viewed these Databases questions