Purchase Solution

Three example C++ programs

Not what you're looking for?

Ask Custom Question

Please assist with questions 1, 2, and 3... do not assist with 4. Please see the attached file.

Purchase this Solution

Solution Summary

This solution provides three complete C++ programs. The first program uses a bubble sort to sort a list of strings. The second calculates the difference between two dates. The third shows how to calculate the roots of a polynomial.

Solution Preview

This solution addresses the first three questions in the posting. Each question has an associated cpp file.

The first question deals with sorting an array of names. The sort algorithm used is the bubble sort. The bubble sort is a simple but inefficient sorting algorithm. Due to its simplicity it is easy to implement. However, for longer data sets its inefficiency makes it unsuitable for use.

The basic bubble sort algorithm is to go through the list, from front to back, and compare adjacent elements. If the elements are out of order, swap them. After making one pass through the list then the largest element is guaranteed to be at the end of the list. It
"bubbled" to the end. Since each full pass of the list guarantees the one more element will be in the correct location, we need to do "n" passes. The ...

Purchase this Solution


Free BrainMass Quizzes
Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic Networking Questions

This quiz consists of some basic networking questions.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.