The task is to write a program where the program chooses a number between 1 and 10. A player is then prompted to enter a guess. If the player guess […]

Continue Reading## C++: Create an HTML Table

Create an HTML table. The table body should have at least three rows of three columns. Each of these three columns should be labelled “X”, “Y”, and “Z”. An extra […]

Continue Reading## C++: Elementary Cellular Automaton

An elementary cellular automaton is a one-dimensional cellular automaton where there are two possible states (labeled 0 and 1) and the rule to determine the state of a cell in […]

Continue Reading## C++: Largest Int from Concatenated Ints

Given a set of positive integers, the task is to write a function to order the integers in such a way that the concatenation of the numbers forms the largest […]

Continue Reading## C++: Day of the Week

A company decides that whenever Xmas falls on a Sunday they will give their workers all extra paid holidays so that, together with any public holidays, workers will not have […]

Continue Reading## C++: Menu

Given a list containing a number of strings of which one is to be selected and a prompt string, create a function that: Print a textual menu formatted as an […]

Continue Reading## C++: Five Weekends

The month of October in 2010 has five Fridays, five Saturdays, and five Sundays. The task Write a program to show all months that have this same characteristic of five […]

Continue Reading## C++: Long Multiplication

In this task, explicitly implement long multiplication. This is one possible approach to arbitrary-precision integer algebra. For output, display the result of 2^64 * 2^64. The decimal representation of 2^64 […]

Continue Reading## C++: Anagrams

Two or more words can be composed of the same characters, but in a different order. Using the word list atÂ http://www.puzzlers.org/pub/wordlists/unixdict.txt, find the sets of words that share the same […]

Continue Reading## C++: Leap Year

Determine whether a given year is a leap year in the Gregorian calendar. #include <iostream> bool is_leap_year(int year) { return year % 4 == 0 && (year % 100 != […]

Continue Reading