Starting Out With C++ By Tony Gaddis 7th/8th/9th Edition


Thank you for stopping by my blog on now the 9th version of Starting Out with C++. I appreciate all the support and emails that I have received from all of you. I want to especially thank those that not only used the blog to get help but also contributed possible solutions to help fill in the holes. Remember that this blog is intended to help and you are not doing yourself any favors by simply copying and pasting one of many possible solutions that I found that work on an exercise problem.

I do intend to write more exam/quiz questions to round out the study guide and more of the programming challenges - when I get more time.  I'm a student also so I hope you understand.

I have Java and VisualBasic info that I could post if there is enough interest.  Leave a comment and let me know if it is worth posting or not.  Good luck in your classes!

12/02/2014. After debating whether to post more on the 7th edition, I've decided to start posting the solutions to the exercises from the 8th edition. I didn't buy the myprogramminglab version this time so you might have to adjust your code accordingly. The compiler I use to write the code is the Microsoft VisualStudio C++ compiler in command line mode so that works with the examples in the book.

Please note that this blog is not part of turing's Craft (www.turingscraft.com) and we do not provide the solution manual for the course (codelab) or myprogramminglab.

I really like Tony Gaddis' Starting Out With books so here we go...

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;

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

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

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