ماسج 2

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 5

‫قسم الكمبيوتر وتقنية المعلومات‬

1 ‫تمارين عملي – مادة برمجة حاسب‬

2 ‫التمارين رقم‬
. ‫برنامج يقوم بتحويل املسافة من متر إلى كيلو متر‬ -1

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"Enter Area with meter :";
cin>>Area ;
Area =Area /1000;
cout<<"Area ="<<Area <<" km"<<endl;
}

. ‫برنامج يقوم بتحويل املسافة من متر إلى سنتيمتر‬ -2

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"enter Area with meter :";
cin>>Area ;
Area =Area *100;
cout<<"Area ="<<Area <<" cm"<<endl;
}

. ‫برنامج يقوم بتحويل املسافة من سنتيمتر إلى متر‬ -3

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"enter Area with centimeter :";
cin>>Area ;
Area =Area /100;
cout<<"Area ="<<Area<<" Meter " <<endl;
}

1
Eng.Bandar Dhafer
‫قسم الكمبيوتر وتقنية المعلومات‬
1 ‫تمارين عملي – مادة برمجة حاسب‬

. ‫برنامج يقوم بتحويل املسافة من سنتيمتر إلى كيلو متر‬ -4

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"enter Area with centimeter :";
cin>>Area ;
Area =Area /100000;
cout<<"Area ="<<Area <<" km "<<endl;
}

. ‫برنامج يقوم بتحويل املسافة من كيلو متر إلى متر‬ -5

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"enter Area with kilometer :";
cin>>Area ;
Area =Area *1000;
cout<<"Area ="<<Area<<" meter " <<endl;
}

. ‫برنامج يقوم بتحويل املسافة من كيلو متر إلى سنتيمتر‬ -6

#include<iostream>
using namespace std;
main()
{
float Area ;
cout<<"enter Area with kilometer :";
cin>>Area ;
Area =Area *100000;
cout<<"Area ="<<Area <<" cm"<<endl;
}

2
Eng.Bandar Dhafer
‫قسم الكمبيوتر وتقنية المعلومات‬
1 ‫تمارين عملي – مادة برمجة حاسب‬

. ‫برنامج يقوم بتحويل الوقت من دقائق إلى ساعات‬ -7

#include<iostream>
using namespace std;
main()
{
float minutes , hour ;
cout<<"enter minutes:";
cin>>minutes;
hour =minutes/60;
cout<<"="<<hour <<" hours"<<endl;
}

. ‫برنامج يقوم بتحويل الوقت من دقائق إلى ثوان‬ -8

#include<iostream>
using namespace std;
main()
{
float minutes , seconds ;
cout<<"enter minutes:";
cin>>minutes;
seconds =minutes*60;
cout<<"="<<seconds <<" seconds "<<endl;
}

. ‫برنامج يقوم بتحويل الوقت من ثوان إلى دقائق‬ -9

#include<iostream>
using namespace std;
main()
{
float minutes , seconds ;
cout<<"enter seconds :";
cin>>seconds ;
minutes =seconds /60;
cout<<"="<<minutes <<" minutes "<<endl;
}

3
Eng.Bandar Dhafer
‫قسم الكمبيوتر وتقنية المعلومات‬
1 ‫تمارين عملي – مادة برمجة حاسب‬

. ‫برنامج يقوم بتحويل الوقت من ثوان إلى ساعات‬ -10

#include<iostream>
using namespace std;
main()
{
float hours , seconds ;
cout<<"enter seconds :";
cin>>seconds ;
hours =seconds /3600;
cout<<"="<<hours <<" hours "<<endl;
}

. ‫برنامج يقوم بتحويل الوقت من ساعات إلى دقائق‬ -11

#include<iostream>
using namespace std;
main()
{
float minutes , hours ;
cout<<"enter hours:";
cin>>hours ;
minutes =hours *60;
cout<<"="<<minutes <<" minutes "<<endl;
}

. ‫برنامج يقوم بتحويل الوقت من ساعات إلى ثوان‬ -12

#include<iostream>
using namespace std;
main()
{
float hours , seconds ;
cout<<"enter hours:";
cin>>hours;
seconds =hours * 3600;
cout<<"="<<seconds <<" seconds "<<endl;
}

4
Eng.Bandar Dhafer
‫قسم الكمبيوتر وتقنية المعلومات‬
1 ‫تمارين عملي – مادة برمجة حاسب‬
ً
‫برنامج يقوم باستقبال الوقت بالثواني ثم يقوم بالتحويل الى ساعات ودقائق فمثال ( إذا قام املستخدم‬ -13
. ‫ بالساعة‬1:23:20 ‫ ثانية الى‬5000 ‫بادخال‬

#include<iostream>
using namespace std;
main)(
{
int hours,minutes,seconds,temp;
cout<<"enter seconds:";
cin>>seconds;
hours=seconds/3600;
temp=seconds%3600;
minutes=temp/60;
seconds=temp%60;
cout<<"="<< hours <<":"<<minutes<<":"<<seconds<<endl;
}

‫برنامج يقوم باستقبال املسافة بالسنتميتر ثم يقوم بالتحويل الى كيلو ومتر وسنتميتر فمثال إذا أدخل‬ -14
. ‫ بالكيلومتر‬1:515:33 ‫ سنتمتر سيتم تحويلها الى‬151553 ‫املستخدم‬

#include<iostream>
using namespace std;
main)(
{
int kilometers , meters , centimeters,temp;
cout<<"enter centimeters:";
cin>>centimeters;
kilometers =centimeters /100000;
temp =centimeters %100000;
meters =temp /100;
centimeters =temp %100;
cout<<"="<< kilometers
<<":"<<meters<<":"<<centimeters<<endl;
}

5
Eng.Bandar Dhafer

You might also like