أول انجاز صغير لي في صديقة عمري ودربي c++
طبعا البرنامج يشمل التوثيق
//***************************************
//*Author :Ahmad shalabi. *
//***************************************
//*************************************************
//This program read the length in feet and inches.
//Then Show the length in centimeters.
//*************************************************
#include "stdafx.h"
#include <iostream>
using namespace std;
// This is fixed name to use in formuals convert and calculate.
const double CENTIMETER_PER_INCHES = 2.54;
const int INCHES_PER_FOOT = 12;
int _tmain(int argc, _TCHAR* argv[])
{
// This is the variable will the program use in formuals.
int inche;
int foot;
int totalInche;
double centimeter;
cout << "Please Enter The Length IN Inche and Foot" << endl
<<"in an Inegarel Number,Sprate with space : "
<<endl;
cin >> inche >> foot; // This statement read length in inche and foot.
//****************************************************************
//This statements convert the length in foot to inche then calculate the total inches in centimeter.
totalInche = (INCHES_PER_FOOT * foot) + inche;
centimeter = totalInche * CENTIMETER_PER_INCHES;
//****************************************************************
cout << "Lenght = "
<< centimeter << "cm" <<endl; // this statements show length in centimeter.
system("pause"); // this statements stop the system due to the user see the result
return 0;
}