Inheritance is an operation of type algebra that creates a new type from one or several parent types. The obtained type is called derived type. It inh
Continue ReadingC++: Create a Two-Dimensional Array at Runtime
Get two integers from the user, then create a two-dimensional array where the two dimensions have the sizes given by those numbers, and which can be a
Continue ReadingC++: Binary Search Tree Insertion
void insert(Node*& root, int data) { if (!root){ root = new Node(data); } else if (data < root->data){ insert(root->left,
Continue ReadingC++: Even or Odd
Test whether an integer is even or odd. There is more than one way to solve this task: Use the even and odd predicates, if the language provid
Continue ReadingC++: Equilibrium Index
An equilibrium index of a sequence is an index into the sequence such that the sum of elements at lower indices is equal to the sum of elements at hig
Continue ReadingC++: File Modification Time
This task will attempt to get and set the modification time of a file. #include <boost/filesystem/operations.hpp> #include <ctime> #i
Continue ReadingC++: Normal PDF
const double Pi = 3.14159265359; // Standard Normal probability density function double Normal_PDF(const double & x) // Normal PDF(x) = e
Continue ReadingC++: Hello World Graphical
In this User Output task, the goal is to display the string "Goodbye, World!" on a GUI object (alert box, plain window, text area, etc.). Library:
Continue ReadingBest C Questions
[pt_view id="73f49b1b41"]
Continue ReadingC++: Function Definition
A function is a body of code that returns a value. The value returned may depend on arguments provided to the function. Write a definition of a fun
Continue Reading