Answers for C++ Course using "Starting out with C++ : from control structures through objects" by Tony Gaddis. 7/8th ed. I used the Pearson myprogramminglab to complete the homework. Here are my solutions/answers for the exercises/labs so please use the test bank as a GUIDE if you're stuck. Let me know if you find a better solution to a problem or any of the programming challenges. Thanks in advance for your support! Send in missing programming challenges to cplusplus.answers@gmail.com
Open Help Request
Here is where you can ask your fellow blog visitors for help also. Since we have a lot of visitors you might be able to get at least a pointer on how to tackle a problem. Please post the problem in the comment section and how you attempted to solve it.
Exericse Number
Help
14.2: Friends of Classes 11220
Solution by nowiita
class Window
{
private:
int width;
int height;
public:
Window(int w, int h)
{
width = w;
height = h;
}
friend bool areSameSize (Window, Window);
};
bool areSameSize (Window obj1, Window obj2)
{
bool same = false;
if (obj1.width == obj2.width && obj1.height == obj2.height)
same = true;
return same;
}
Chapter 6 Quiz Starting Out With C++ 006
Which of the following is the function header?
a. calculateBonus()
b. decimal calculateBonus()
c. return calculatedBonus;
a. calculateBonus()
b. decimal calculateBonus()
c. return calculatedBonus;
Chapter 6 Quiz Starting Out With C++ 005
What function is automatically called when a program starts in C++?
a. the include function
b. the main function
c. the return function
d. the displayMessage function
a. the include function
b. the main function
c. the return function
d. the displayMessage function
Exericse Number
Chapter 06,
Quiz
Chapter 6 Quiz Starting Out With C++ 004
What is a void function?
a. a function that does not have a body
b. a function that does not return a value
c. a function that doesn't have any parameters
d. a function that doesn't have any arguments
a. a function that does not have a body
b. a function that does not return a value
c. a function that doesn't have any parameters
d. a function that doesn't have any arguments
Chapter 6 Quiz Starting Out With C++ 003
Which of the following are parts of the function definition?
a. return type
b. name
c. parameter list
d. argument list
e. body
a. return type
b. name
c. parameter list
d. argument list
e. body
Subscribe to:
Posts (Atom)