Programming Language | Year Created | Creator(s) | Purpose of Creation |
---|---|---|---|
Java | 1995 | James Gosling | General Purpose programming language, used to create many variety of application for different computing platforms. |
C++ | 1983 | Bjarne Stroustrup | General purpose programming language, used to create large programs and performance critical systems. |
C | 1972 | Dennis Ritchie | General Purpose programming language, but mostly used today for system programming. |
Python | 1991 | Guido Van Rossum | General Purpose but mostly used for research and scientific programming. |
PHP | 1995 | Rasmus Lerdorf | Web scripting language, used to create scripts that run on web server. |
Ruby | 1995 | Yukihiro Matsumoto | General Purpose programming language Can be used in Web Development. |
Lisp | 1958 | John McCarthy | Artificial Intelligence. |
Clojure | 2007 | Rich Hickey | General Purpose programming with tight Java Integration. |
Visual Basic | 1991 | Microsoft Corp., Alan Cooper created the drag and drop design. | Creating GUI applications for Windows. |
C# | 2000 | Microsoft Corp. with Anders Hejlsberg as chief designer. | Creating general applications for Windows Operating System. |
Lua | 1993 | Roberto Lerusalimschy | Used as scripting language by Game Programmers. |
Perl | 1987 | Larry Wall | General Purpose programming language, used as glue language in tying different systems. |
MATLAB | 1984 | MathWorks | Numerical Computing. |
Fortran | 1957 | John Backus | Numerical Computing. |
COBOL | 1959 | Howard Bromberg, Howard Discount, Vernon Reeves, Jean E. Sammet, William Selden and Gertrude Tierney. | Business Applications. |
Pascal | 1970 | Niklaus Wirth | Academic Fields |
Tcl | 1988 | John Ousterhout | Rapid prototyping and embedded systems. |
F# | 2005 | Don Syme | Mostly used as cross-platform CLI language. |
JavaScript | 1995 | Brendan Eich | Creating scripts that run on client browser. |
Erlang | 1986 | Ericsson | Mostly used for concurrent programming. |
Objective-C | 1983 | Brad Cox and Tom Love | Creating application iOS and OS X |
Tuesday, 18 August 2015
SOME PROGRAMMING LANGUAGES WITH THE YEAR THEY WERE CREATED, THE PEOPLE WHO CREATE THEM AND THE PURPOSE OF THEIR CREATION
Wednesday, 27 May 2015
WHICH ONE SHOULD I LEARN FIRST BETWEEN C AND C ++?
This
question is very nice, it is like someone who is aspiring to be a car driver
asking should he start learning car on his own or should he go to Driving
School. Here, learning car on your own means learning C++ while going to
driving school means learning C. However, it all depends on how prepared you
are.
The support of Object-Oriented Programming is what makes C++ more powerful than C, and you can create almost anything with C++ that is written in C. The power of C comes from the ability of the language to interact easily with hardware. Hence, C is almost mainly used today to write applications that are very close to the hardware and to program Embedded Systems like Traffic Light, MP3 Players, and Smart Watches etc.
As I said earlier it all depends on how prepared you are and why do you want to learn one of the two languages. If you want to learn all the two I recommend you start with C first then move to C++.
C++ UNIT CONVERTER
Below
is the Source Code of a C++ Unit Converter I wrote couple of weeks ago. I use
Object-Oriented approach in creating the converter, and it is also not a GUI
app it runs on command prompt.
The first source code is the header file; the class that contains all the conversion functions is defined in the header file.
The Header File
class unit_conversion{
public:
double secondToMinute(double x);
double minuteToSecond(double x);
double secondToHour(double x);
double hourToSecond(double x);
double minuteToHour(double x);
double hourToMinute(double x);
double meterToKilometer(double x);
double kilometerToMeter(double x);
double hectToSqmet(double x);
double sqmetToHect(double x);
double acreToSqmet(double x);
double sqmetToAcre(double x);
double celToFah(double x);
double fahToCel(double x);
double kelToCel(double x);
double celToKel(double x);
double meterToYard(double x);
double yardToMeter(double x);
double meterToInch(double x);
double inchToMeter(double x);
double mileToKilometer(double x);
double kilometerToMile(double x);
double literToGallon(double x);
double gallonToLiter(double x);
double literToCube(double x);
double cubeToLitre(double x);
double literToPint(double x);
double pintToLiter(double x);
double literToGill(double x);
double gillToLiter(double x);
double kilogramToTonne(double x);
double tonneToKilogeam(double x);
double kilogramToOunce(double x);
double ounceToKilogram(double x);
double kilogramToPound(double x);
double poundToKilogram(double x);
double kilogramToSlug(double x);
double slugToKilogram(double x);
private:
//double input;
};
double unit_conversion::secondToMinute(double x){
return x/60;
}
double unit_conversion::minuteToSecond(double x){
return x * 60;
}
double unit_conversion::secondToHour(double x){
return x/3600;
}
double unit_conversion::hourToSecond(double x){
return x * 3600;
}
double unit_conversion::minuteToHour(double x){
return x/60;
}
double unit_conversion::hourToMinute(double x){
return x * 60;
}
double unit_conversion::meterToKilometer(double x){
return x/1000;
}
double unit_conversion::kilometerToMeter( double x){
return x * 1000;
}
double unit_conversion::hectToSqmet(double x){
return x * 10000;
}
double unit_conversion::sqmetToHect(double x){
return x/10000;
}
double unit_conversion::acreToSqmet(double x){
return x * 4046.856422;
}
double unit_conversion::sqmetToAcre(double x){
return x/4046.856422;
}
double unit_conversion::celToFah(double x){
return (x * 9/5) + 32;
}
double unit_conversion::fahToCel(double x){
return (x - 32) * 5/9;
}
double unit_conversion::kelToCel(double x){
return x - 273.15;
}
double unit_conversion::celToKel(double x){
return x + 273.15;
}
double unit_conversion::meterToYard(double x){
return x / 0.9144;
}
double unit_conversion::yardToMeter(double x){
return x * 0.9144;
}
double unit_conversion::meterToInch(double x){
return x / 0.0254;
}
double unit_conversion::inchToMeter(double x){
return x * 0.0254;
}
double unit_conversion::mileToKilometer(double x){
return x / 0.62137;
}
double unit_conversion::kilometerToMile(double x){
return x * 0.62137;
}
double unit_conversion::literToGallon(double x){
return x / 4.546; // gallon is in UK conversion
}
double unit_conversion::gallonToLiter(double x){
return x * 4.546; // gallon is in UK conversion
}
double unit_conversion::literToCube(double x){
return x / 1000;
}
double unit_conversion::cubeToLitre(double x){
return x * 1000;
}
double unit_conversion::literToPint(double x){
return x / 0.568; //pint is in UK Conversion
}
double unit_conversion::pintToLiter(double x){
return x * 0.568; //pint is in UK Conversion
}
double unit_conversion::literToGill(double x){
return x / 0.142;
}
double unit_conversion::gillToLiter(double x){
return x * 0.142;
}
double unit_conversion::kilogramToTonne(double x){
return x / 1000;
}
double unit_conversion::tonneToKilogeam(double x){
return x * 1000;
}
double unit_conversion::kilogramToOunce(double x){
return x / 0.0283495;
}
double unit_conversion::ounceToKilogram(double x){
return x * 0.0283495;
}
double unit_conversion::kilogramToPound(double x){
return x / 0.45;
}
double unit_conversion::poundToKilogram(double x){
return x * 0.45;
}
double unit_conversion::kilogramToSlug(double x){
return x / 14.6;
}
double unit_conversion::slugToKilogram(double x){
return x * 14.6;
}
The Main Program Source File
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "conversion.h"
using namespace std;
int user_selection = 99;
double value;
int main(){
unit_conversion converter;
cout << "THE UNIT CONVERTER" << endl;
while (user_selection != 0)
{
cout << "\n";
cout << "Enter 1 For Time Conversion\n";
cout << "Enter 2 For Area Conversion\n";
cout << "Enter 3 For Temperature Conversion\n";
cout << "Enter 4 For Volume Conversion\n";
cout << "Enter 5 For Length Conversion\n";
cout << "Enter 6 For Mass Conversion\n";
cout << "Enter 0 To Exit\n";
cin >> user_selection;
if(user_selection == 1)//Time Conversion Block
{
system("CLS");
cout << '\n';
while(user_selection != 9)
{
cout << "Enter 1 For Second To Minute\n";
cout << "Enter 2 For Minute To Second\n";
cout << "Enter 3 For Second To Hour\n";
cout << "Enter 4 For Hour To Second\n";
cout << "Enter 5 For Minute To Hour\n";
cout << "Enter 6 For Hour To Minute\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Second(s): ";
cin >> value;
cout << value << " Second(s) is " << converter.secondToMinute(value) << " Minute(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Minutes(s): ";
cin >> value;
cout << value << " Minute(s) is " << converter.minuteToSecond(value) << " Second(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter The Second(s): ";
cin >> value;
cout << value << " Second(s) is " << converter.secondToHour(value) << " Hour(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Hour(s): ";
cin >> value;
cout << value << " Hour(s) is " << converter.hourToSecond(value) << " Second(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter The Minute(s): ";
cin >> value;
cout << value << " Minute(s) is " << converter.minuteToHour(value) << " Hour(s) " << endl;
}
else if (user_selection == 6)
{
cout << "Enter The Hour(s): ";
cin >> value;
cout << value << " Hour(s) is " << converter.hourToMinute(value) << " Minute(s) " << endl;
}
}
}
else if(user_selection == 2) // Area Conversion Block
{
while(user_selection != 9)
{
cout << "Press 1 For Hectare To Square Meter \n";
cout << "Press 2 For Square Meter To Hectare \n";
cout << "Enter 3 For Acre to Square Meter \n";
cout << "Enter 4 For Square Meter To Acre \n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Hectare(s): ";
cin >> value;
cout << value << " Hectare(s) is " << converter.hectToSqmet(value) << " Square Meter(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Square Meter(s): ";
cin >> value;
cout << value << " Square Meter(s) is " << converter.sqmetToHect(value) << " Hectare(s) " << endl;
}
else if (user_selection == 3)
{
cout << "Enter The Acres(s): ";
cin >> value;
cout << value << " Acre(s) " << converter.acreToSqmet(value) << " Square Meter(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Square Meter(s): ";
cin >> value;
cout << value << " Square Meter(s) is " << converter.sqmetToAcre(value) << " Acre(s) " << endl;
}
}
}
else if(user_selection == 3) // Temperature Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Celsius To Fahrenheit \n";
cout << "Enter 2 For Fahrenheit To Celsius \n";
cout << "Enter 3 For Celsius To Kelvin\n";
cout << "Enter 4 For Kelvin To Celsius\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Celsius: ";
cin >> value;
cout << value << " Celsius is " << converter.celToFah(value) << " Fahrenheit " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Fahrenheit: ";
cin >> value;
cout << value << " Fahrenheit is " << converter.fahToCel(value) << " Celsius " << endl;
}
else if(user_selection == 3)
{
cout << "Enter The Celsius: ";
cin >> value;
cout << value << " Celsius is " << converter.celToKel(value) << " Kelvin " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Kelvin: ";
cin >> value;
cout << value << " Kelvin is " << converter.kelToCel(value) << " Celsius " << endl;
}
}
}
else if(user_selection == 4) // Voluume Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Liter To Gallon\n";
cout << "Enter 2 For Gallon To Liter\n";
cout << "Enter 3 For Liter To Cube\n";
cout << "Enter 4 For Cube To Liter\n";
cout << "Enter 5 For Liter To Pint\n";
cout << "Enter 6 For Pint To Liter\n";
cout << "Enter 7 For Liter To Gill\n";
cout << "Enter 8 For Gill To Liter\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToGallon(value) << " gallon(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter Gallon(s): ";
cin >> value;
cout << value << " gallon(s) is " << converter.gallonToLiter(value) << " liter(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToCube(value) << " cube(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Cube(s): "; // Cubic Centimeter
cin >> value;
cout << value << " cube(s) is " << converter.cubeToLitre(value) << " liter(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToPint(value) << " pint(s) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Pint(s): ";
cin >> value;
cout << value << " pint(s) is " << converter.pintToLiter(value) << " liter(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToGill(value) << " gill(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Gill(s): ";
cin >> value;
cout << value << " gill(s) is " << converter.gillToLiter(value) << " liter(s) " << endl;
}
}
}
else if(user_selection == 5) // Length Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Meter To Kilometer\n";
cout << "Enter 2 For Kilometer To Meter\n";
cout << "Enter 3 For Meter To Yard\n";
cout << "Enter 4 For Yard To Meter\n";
cout << "Enter 5 For Meter To Inch\n";
cout << "Enter 6 For Inch To Meter\n";
cout << "Enter 7 For Mile To Kilometer\n";
cout << "Enter 8 For Kilometer To Mile\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToKilometer(value) << " kilometer(s)" << endl;
}
else if(user_selection == 2)
{
cout << "Enter Kilometer(s): ";
cin >> value;
cout << value << " kilometer(s) is " << converter.kilometerToMeter(value) << " meter(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToYard(value) << " yard(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Yard(s): ";
cin >> value;
cout << value << " yard(s) is " << converter.yardToMeter(value) << " meter(s) " << endl;
}
else if (user_selection == 5)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToInch(value) << " inch(es) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Inch(es): ";
cin >> value;
cout << value << " inch(es) is " << converter.inchToMeter(value) << " meter(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Mile(s): ";
cin >> value;
cout << value << " mile(s) is " << converter.mileToKilometer(value) << " kilometer(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Kilometer(s): ";
cin >> value;
cout << value << " kilometer(s) " << converter.kilometerToMile(value) << " mile(s) " << endl;
}
}
}
else if(user_selection == 6) // Mass Vonversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Kilogram To Tonne\n";
cout << "Enter 2 For Tonne To Kilogram\n";
cout << "Enter 3 For Kilogram To Ounce\n";
cout << "Enter 4 For Ounce To Kilogram\n";
cout << "Enter 5 For Kilogram To Pound\n";
cout << "Enter 6 For Pound To Kilogram\n";
cout << "Enter 7 For Kilogram To Slug\n";
cout << "Enter 8 For Slug To Kilogram\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToTonne(value) << " tonne(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter Tonne(s): ";
cin >> value;
cout << value << " tonne(s) is " << converter.tonneToKilogeam(value) << " kilogram(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToOunce(value) << " ounce(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Ounce(s): ";
cin >> value;
cout << value << " ounce(s) is " << converter.ounceToKilogram(value) << " kilogram(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToPound(value) << " pound(s) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Pound(s): ";
cin >> value;
cout << value << " pound(s) is " << converter.poundToKilogram(value) << " kilogram(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToSlug(value) << " slug(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Slug(s): ";
cin >> value;
cout << value << " slug(s) is " << converter.slugToKilogram(value) << " kilogram(s) " << endl;
}
}
}
}
}
The first source code is the header file; the class that contains all the conversion functions is defined in the header file.
The Header File
class unit_conversion{
public:
double secondToMinute(double x);
double minuteToSecond(double x);
double secondToHour(double x);
double hourToSecond(double x);
double minuteToHour(double x);
double hourToMinute(double x);
double meterToKilometer(double x);
double kilometerToMeter(double x);
double hectToSqmet(double x);
double sqmetToHect(double x);
double acreToSqmet(double x);
double sqmetToAcre(double x);
double celToFah(double x);
double fahToCel(double x);
double kelToCel(double x);
double celToKel(double x);
double meterToYard(double x);
double yardToMeter(double x);
double meterToInch(double x);
double inchToMeter(double x);
double mileToKilometer(double x);
double kilometerToMile(double x);
double literToGallon(double x);
double gallonToLiter(double x);
double literToCube(double x);
double cubeToLitre(double x);
double literToPint(double x);
double pintToLiter(double x);
double literToGill(double x);
double gillToLiter(double x);
double kilogramToTonne(double x);
double tonneToKilogeam(double x);
double kilogramToOunce(double x);
double ounceToKilogram(double x);
double kilogramToPound(double x);
double poundToKilogram(double x);
double kilogramToSlug(double x);
double slugToKilogram(double x);
private:
//double input;
};
double unit_conversion::secondToMinute(double x){
return x/60;
}
double unit_conversion::minuteToSecond(double x){
return x * 60;
}
double unit_conversion::secondToHour(double x){
return x/3600;
}
double unit_conversion::hourToSecond(double x){
return x * 3600;
}
double unit_conversion::minuteToHour(double x){
return x/60;
}
double unit_conversion::hourToMinute(double x){
return x * 60;
}
double unit_conversion::meterToKilometer(double x){
return x/1000;
}
double unit_conversion::kilometerToMeter( double x){
return x * 1000;
}
double unit_conversion::hectToSqmet(double x){
return x * 10000;
}
double unit_conversion::sqmetToHect(double x){
return x/10000;
}
double unit_conversion::acreToSqmet(double x){
return x * 4046.856422;
}
double unit_conversion::sqmetToAcre(double x){
return x/4046.856422;
}
double unit_conversion::celToFah(double x){
return (x * 9/5) + 32;
}
double unit_conversion::fahToCel(double x){
return (x - 32) * 5/9;
}
double unit_conversion::kelToCel(double x){
return x - 273.15;
}
double unit_conversion::celToKel(double x){
return x + 273.15;
}
double unit_conversion::meterToYard(double x){
return x / 0.9144;
}
double unit_conversion::yardToMeter(double x){
return x * 0.9144;
}
double unit_conversion::meterToInch(double x){
return x / 0.0254;
}
double unit_conversion::inchToMeter(double x){
return x * 0.0254;
}
double unit_conversion::mileToKilometer(double x){
return x / 0.62137;
}
double unit_conversion::kilometerToMile(double x){
return x * 0.62137;
}
double unit_conversion::literToGallon(double x){
return x / 4.546; // gallon is in UK conversion
}
double unit_conversion::gallonToLiter(double x){
return x * 4.546; // gallon is in UK conversion
}
double unit_conversion::literToCube(double x){
return x / 1000;
}
double unit_conversion::cubeToLitre(double x){
return x * 1000;
}
double unit_conversion::literToPint(double x){
return x / 0.568; //pint is in UK Conversion
}
double unit_conversion::pintToLiter(double x){
return x * 0.568; //pint is in UK Conversion
}
double unit_conversion::literToGill(double x){
return x / 0.142;
}
double unit_conversion::gillToLiter(double x){
return x * 0.142;
}
double unit_conversion::kilogramToTonne(double x){
return x / 1000;
}
double unit_conversion::tonneToKilogeam(double x){
return x * 1000;
}
double unit_conversion::kilogramToOunce(double x){
return x / 0.0283495;
}
double unit_conversion::ounceToKilogram(double x){
return x * 0.0283495;
}
double unit_conversion::kilogramToPound(double x){
return x / 0.45;
}
double unit_conversion::poundToKilogram(double x){
return x * 0.45;
}
double unit_conversion::kilogramToSlug(double x){
return x / 14.6;
}
double unit_conversion::slugToKilogram(double x){
return x * 14.6;
}
The Main Program Source File
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include "conversion.h"
using namespace std;
int user_selection = 99;
double value;
int main(){
unit_conversion converter;
cout << "THE UNIT CONVERTER" << endl;
while (user_selection != 0)
{
cout << "\n";
cout << "Enter 1 For Time Conversion\n";
cout << "Enter 2 For Area Conversion\n";
cout << "Enter 3 For Temperature Conversion\n";
cout << "Enter 4 For Volume Conversion\n";
cout << "Enter 5 For Length Conversion\n";
cout << "Enter 6 For Mass Conversion\n";
cout << "Enter 0 To Exit\n";
cin >> user_selection;
if(user_selection == 1)//Time Conversion Block
{
system("CLS");
cout << '\n';
while(user_selection != 9)
{
cout << "Enter 1 For Second To Minute\n";
cout << "Enter 2 For Minute To Second\n";
cout << "Enter 3 For Second To Hour\n";
cout << "Enter 4 For Hour To Second\n";
cout << "Enter 5 For Minute To Hour\n";
cout << "Enter 6 For Hour To Minute\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Second(s): ";
cin >> value;
cout << value << " Second(s) is " << converter.secondToMinute(value) << " Minute(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Minutes(s): ";
cin >> value;
cout << value << " Minute(s) is " << converter.minuteToSecond(value) << " Second(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter The Second(s): ";
cin >> value;
cout << value << " Second(s) is " << converter.secondToHour(value) << " Hour(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Hour(s): ";
cin >> value;
cout << value << " Hour(s) is " << converter.hourToSecond(value) << " Second(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter The Minute(s): ";
cin >> value;
cout << value << " Minute(s) is " << converter.minuteToHour(value) << " Hour(s) " << endl;
}
else if (user_selection == 6)
{
cout << "Enter The Hour(s): ";
cin >> value;
cout << value << " Hour(s) is " << converter.hourToMinute(value) << " Minute(s) " << endl;
}
}
}
else if(user_selection == 2) // Area Conversion Block
{
while(user_selection != 9)
{
cout << "Press 1 For Hectare To Square Meter \n";
cout << "Press 2 For Square Meter To Hectare \n";
cout << "Enter 3 For Acre to Square Meter \n";
cout << "Enter 4 For Square Meter To Acre \n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Hectare(s): ";
cin >> value;
cout << value << " Hectare(s) is " << converter.hectToSqmet(value) << " Square Meter(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Square Meter(s): ";
cin >> value;
cout << value << " Square Meter(s) is " << converter.sqmetToHect(value) << " Hectare(s) " << endl;
}
else if (user_selection == 3)
{
cout << "Enter The Acres(s): ";
cin >> value;
cout << value << " Acre(s) " << converter.acreToSqmet(value) << " Square Meter(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Square Meter(s): ";
cin >> value;
cout << value << " Square Meter(s) is " << converter.sqmetToAcre(value) << " Acre(s) " << endl;
}
}
}
else if(user_selection == 3) // Temperature Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Celsius To Fahrenheit \n";
cout << "Enter 2 For Fahrenheit To Celsius \n";
cout << "Enter 3 For Celsius To Kelvin\n";
cout << "Enter 4 For Kelvin To Celsius\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter The Celsius: ";
cin >> value;
cout << value << " Celsius is " << converter.celToFah(value) << " Fahrenheit " << endl;
}
else if(user_selection == 2)
{
cout << "Enter The Fahrenheit: ";
cin >> value;
cout << value << " Fahrenheit is " << converter.fahToCel(value) << " Celsius " << endl;
}
else if(user_selection == 3)
{
cout << "Enter The Celsius: ";
cin >> value;
cout << value << " Celsius is " << converter.celToKel(value) << " Kelvin " << endl;
}
else if(user_selection == 4)
{
cout << "Enter The Kelvin: ";
cin >> value;
cout << value << " Kelvin is " << converter.kelToCel(value) << " Celsius " << endl;
}
}
}
else if(user_selection == 4) // Voluume Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Liter To Gallon\n";
cout << "Enter 2 For Gallon To Liter\n";
cout << "Enter 3 For Liter To Cube\n";
cout << "Enter 4 For Cube To Liter\n";
cout << "Enter 5 For Liter To Pint\n";
cout << "Enter 6 For Pint To Liter\n";
cout << "Enter 7 For Liter To Gill\n";
cout << "Enter 8 For Gill To Liter\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToGallon(value) << " gallon(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter Gallon(s): ";
cin >> value;
cout << value << " gallon(s) is " << converter.gallonToLiter(value) << " liter(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToCube(value) << " cube(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Cube(s): "; // Cubic Centimeter
cin >> value;
cout << value << " cube(s) is " << converter.cubeToLitre(value) << " liter(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToPint(value) << " pint(s) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Pint(s): ";
cin >> value;
cout << value << " pint(s) is " << converter.pintToLiter(value) << " liter(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Liter(s): ";
cin >> value;
cout << value << " liter(s) is " << converter.literToGill(value) << " gill(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Gill(s): ";
cin >> value;
cout << value << " gill(s) is " << converter.gillToLiter(value) << " liter(s) " << endl;
}
}
}
else if(user_selection == 5) // Length Conversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Meter To Kilometer\n";
cout << "Enter 2 For Kilometer To Meter\n";
cout << "Enter 3 For Meter To Yard\n";
cout << "Enter 4 For Yard To Meter\n";
cout << "Enter 5 For Meter To Inch\n";
cout << "Enter 6 For Inch To Meter\n";
cout << "Enter 7 For Mile To Kilometer\n";
cout << "Enter 8 For Kilometer To Mile\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToKilometer(value) << " kilometer(s)" << endl;
}
else if(user_selection == 2)
{
cout << "Enter Kilometer(s): ";
cin >> value;
cout << value << " kilometer(s) is " << converter.kilometerToMeter(value) << " meter(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToYard(value) << " yard(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Yard(s): ";
cin >> value;
cout << value << " yard(s) is " << converter.yardToMeter(value) << " meter(s) " << endl;
}
else if (user_selection == 5)
{
cout << "Enter Meter(s): ";
cin >> value;
cout << value << " meter(s) is " << converter.meterToInch(value) << " inch(es) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Inch(es): ";
cin >> value;
cout << value << " inch(es) is " << converter.inchToMeter(value) << " meter(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Mile(s): ";
cin >> value;
cout << value << " mile(s) is " << converter.mileToKilometer(value) << " kilometer(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Kilometer(s): ";
cin >> value;
cout << value << " kilometer(s) " << converter.kilometerToMile(value) << " mile(s) " << endl;
}
}
}
else if(user_selection == 6) // Mass Vonversion Block
{
while(user_selection != 9)
{
cout << "Enter 1 For Kilogram To Tonne\n";
cout << "Enter 2 For Tonne To Kilogram\n";
cout << "Enter 3 For Kilogram To Ounce\n";
cout << "Enter 4 For Ounce To Kilogram\n";
cout << "Enter 5 For Kilogram To Pound\n";
cout << "Enter 6 For Pound To Kilogram\n";
cout << "Enter 7 For Kilogram To Slug\n";
cout << "Enter 8 For Slug To Kilogram\n";
cout << "Enter 9 To Go Back\n";
cin >> user_selection;
if(user_selection == 1)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToTonne(value) << " tonne(s) " << endl;
}
else if(user_selection == 2)
{
cout << "Enter Tonne(s): ";
cin >> value;
cout << value << " tonne(s) is " << converter.tonneToKilogeam(value) << " kilogram(s) " << endl;
}
else if(user_selection == 3)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToOunce(value) << " ounce(s) " << endl;
}
else if(user_selection == 4)
{
cout << "Enter Ounce(s): ";
cin >> value;
cout << value << " ounce(s) is " << converter.ounceToKilogram(value) << " kilogram(s) " << endl;
}
else if(user_selection == 5)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToPound(value) << " pound(s) " << endl;
}
else if(user_selection == 6)
{
cout << "Enter Pound(s): ";
cin >> value;
cout << value << " pound(s) is " << converter.poundToKilogram(value) << " kilogram(s) " << endl;
}
else if(user_selection == 7)
{
cout << "Enter Kilogram(s): ";
cin >> value;
cout << value << " kilogram(s) is " << converter.kilogramToSlug(value) << " slug(s) " << endl;
}
else if(user_selection == 8)
{
cout << "Enter Slug(s): ";
cin >> value;
cout << value << " slug(s) is " << converter.slugToKilogram(value) << " kilogram(s) " << endl;
}
}
}
}
}
Subscribe to:
Posts (Atom)