Solution: Ask for a user's favorite movies

…Okay.…I hope you had luck with that last challenge,…writing a program to capture your three top favorite movies.…Here's one possible solution to the challenge.…For this solution, remember all classes contain two files.…The hetero file, in my case, movie.h.…And the class file, movie.cpp.…Let's start with the header file.…In the header file, I declared three private data variables.…I have a string for the movie name, an…integer for the year, and a string for the rating.…Next, in my header file, I list all the function prototypes for this class.…They're going to be public.…The first two are constructors.…I have a default constructor.…I have a constructor that takes three…parameters: a string, an int, and a string.…

I have my destructor.…And then I have access and mutator methods for each of the fields.…SetName, getName, setYear, getYear, set Rating, and getRating.…Remember, we don't actually define the functions in the header file.…That's done in the .cpp file.…Let's go take a look at the definition for these functions.…

Resume Transcript Auto-Scroll

Author

Released

7/10/2014

C++ is the gold standard for object-oriented programming languages: an efficient, performance-driven language popular in system software, application software, and even video games. It's a must-know for any modern-day programmer. This course will get you up and running fast. Author Peggy Fisher dissects the anatomy of C++, walking through flow-control features like expressions, loops, decisions, and functions, as well as its object-oriented classes and data structures. Peggy also covers file manipulation, error handling, and further resources to get you started on your own.

Topics include:

Downloading and exploring the C++ IDE

Working with loops

Using predefined functions

Creating custom functions

Creating and instantiating classes

Working with external files

Skill Level Beginner

2h 36m

Duration

988,973

Views

Show MoreShow Less

Q: How do I upgrade the C++ compiler on Mac OS X and Linux?

A: Refer to C/C++ Essential Training for a detailed look at installing or upgrading the C++ compiler on various platforms.

Q: The link to download the Eclipse IDE in the "Download a C++ IDE" movie doesn't work. Where can I find the IDE?

A: Short URLs are case sensitive and need to be typed in exactly as they appear. Type in or simply click http://goo.gl/CzckWp to visit the Eclipse IDE for C/C++ Developers page.