C++ Program to illustrate file handling, inheritance and polymorphism

This program enforces the concept of inheritance and polymorphism which are parts of the Object Oriented Design of the C++ language. The Program accesses a file named roster.dat which must be placed in the same directory in which this source file is executed. The File roster.dat is attached as a separate file, without this file […]

Read More

C++ Program to output nodes of a tree using inorder tree traversal algorithm

This program outputs the nodes of a tree using inorder tree traversal algorithm. Each Node is prefixed by k number of “-” where k is the level of the node. I have included comments along to explain, if you find something confusing, drop a comment. #include “iostream” using namespace std; //This template is for creating […]

Read More

C++ Program to retrieve Capital City for states in the United States.

The aim of this program is to create a little quiz for kids or even adults. To quickly learn the capital city for each state in the United States. Comments are added for explanation. #include <iostream> #include <string> #include <set> #include <map> using namespace std; //State city class definition class stateCity { public: stateCity (const […]

Read More