Tip Bank

DevX - Software Development Resource

Remove an Element in a Sorted Array

To remove an element at a given position in a sorted array, shift all the elements above it down one position. void erase(int a[], int& n, int index) { //

DevX - Software Development Resource

Convert from cubic feet to cubic meters, and vice versa

‘ Convert from cubic feet to cubic meters, and vice versaFunction CubicFeetToCubicMeters(ByVal cuFeet As Double) As Double Return cuFeet * 0.0283End FunctionFunction CubicMetersToCubicFeet(ByVal cuMeters As Double) As Double Return cuMeters

DevX - Software Development Resource

Convert from yards to meters, and vice versa

‘ Convert from yards to meters, and vice versaFunction YardsToMeters(ByVal yards As Double) As Double Return yards * 0.9144End FunctionFunction MetersToYards(ByVal meters As Double) As Double Return meters / 0.9144End

DevX - Software Development Resource

Convert from square feet to square meters, and vice versa

‘ Convert from square feet to square meters, and vice versaFunction SquareFeetToSquareMeters(ByVal squareFeet As Double) As Double Return squareFeet * 0.0929End FunctionFunction SquareMetersToSquareFeet(ByVal squareMeters As Double) As Double Return squareMeters

DevX - Software Development Resource

Convert from inches to centimeters, and vice versa

‘ Convert from inches to centimeters, and vice versaFunction InchesToCentimeters(ByVal inches As Double) As Double Return inches * 2.54End FunctionFunction CentimetersToInches(ByVal centimeters As Double) As Double Return centimeters / 2.54End

DevX - Software Development Resource

Convert from imperial gallons to liters, and vice versa

‘ Convert from imperial gallons to liters, and vice versaFunction UKGallonsToLiters(ByVal gallons As Double) As Double Return gallons * 4.546End FunctionFunction LitersToUKGallons(ByVal liters As Double) As Double Return liters /

DevX - Software Development Resource

Convert from pints to cubic decimeters, and vice versa

‘ Convert from pints to cubic decimeters, and vice versaFunction PintsToCubicDecimeters(ByVal pints As Double) As Double Return pints * 0.568End FunctionFunction CubicDecimetersToPints(ByVal cuDec As Double) As Double Return cuDec /

DevX - Software Development Resource

Convert from ounces to grams, and vice versa

‘ Convert from ounces to grams, and vice versaFunction OuncesToGrams(ByVal ounces As Double) As Double Return ounces * 28.349End FunctionFunction GramsToOunces(ByVal grams As Double) As Double Return grams / 28.349End

DevX - Software Development Resource

Convert from pounds to kilograms, and vice versa

‘ Convert from pounds to kilograms, and vice versaFunction PoundsToKilograms(ByVal pounds As Double) As Double Return pounds * 0.4536End FunctionFunction KilogramsToPounds(ByVal kilograms As Double) As Double Return kilograms / 0.4536End