This web site uses cookies. By using the site you accept the cookie policy.This message is for compliance with the UK ICO law.

<< Previous | 1 | 2 | 3 | 4 | Next >> |
Calculating a Person&#39;s Age in YearsCalculating a Person's Age in Years
Sometimes you will want to calculate the age of a person or of an object and return a result specifying the age in years. This calculation is simple to perform using the properties of the .NET framework's DateTime structure and basic arithmetic operators.
Convert a Number to an Ordinal NumberConvert a Number to an Ordinal Number
Ordinal numbers represent the rank of a cardinal number, such as 1st, 2nd and 3rd. These numbers define the position or rank of a value, rather than just the size or quantity. In this article we will convert integers into English ordinal numbers.
A Generic Read-Only DictionaryA Generic Read-Only Dictionary
The .NET framework includes several types of collection that are designed for use in object models. Amongst these is the ReadOnlyCollection that allows the creation of collections that may not be modified. However, there is no read-only Dictionary type.
Calculating Prime Factors in C#Calculating Prime Factors in C#
The prime factors of a number are all of the prime numbers that can be divided into the number without a remainder. In this article, we will create a method that uses direct search factorisation to generate the list of prime factors for a given value.
Palindrome TesterPalindrome Tester
A palindrome is a word or phrase that reads the same backwards as it does forwards, for example "Madam, I'm Adam". This article describes a simple method for testing the validity of palindrome using basic string manipulation functionality.
Vista-Style File Size FormatterVista-Style File Size Formatter
When copying files, Microsoft Windows Vista shows a dialog box that indicates the size of the remaining items to be processed and the copying speed. The values are formatted with three significant figures. This article explains how to recreate this style.
Prime Numbers - Sieve of EratosthenesPrime Numbers - Sieve of Eratosthenes
The Sieve of Eratosthenes is an ancient algorithm that can be used to find the series of prime numbers. The algorithm is a manual one, requiring a grid of numbers that can be highlighted as primes are found and struck off when not prime.
Rational Number ArithmeticRational Number Arithmetic
Standard arithmetic uses integers or floating-point values for operands and results. Rational numbers, or fractions, are not amongst the standard data types. In this article, we will create a structure for fractions and add arithmetic functionality.
A Generic Searchable Range CollectionA Generic Searchable Range Collection
A common programming task is to match a value to a group of ranges in order to find a value associated with that range. The .NET framework does not provide a collection class to support this functionality so a new generic collection must be created.
Convert Roman Numerals into NumbersConvert Roman Numerals into Numbers
In an earlier article we converted integer values into Roman numerals, an ancient numbering system that uses letters to represent values. In this article we will reverse the process, allowing Roman numerals to be evaluated as an integer.
<< Previous | 1 | 2 | 3 | 4 | Next >> |