-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
>>> البرامج المقررة في المادة <<<
1ملفات وتطبيقات وبرامج جاهزة للتحميل جزء ( 2 ) | برمجة
برامج وتطبيقات من وحدات المقرر برمجة 1
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
case
#include<iostream.h>
void main()
{
char r,g,y,ch;
cin>>ch;
switch(ch)
{
case 'r':cout<<"stop";break; //r == red
case 'y':cout<<"ready";break; //y == yellow
case 'g':cout<<"go";break; //g == green
}
}
void main()
{
char r,g,y,ch;
cin>>ch;
switch(ch)
{
case 'r':cout<<"stop";break; //r == red
case 'y':cout<<"ready";break; //y == yellow
case 'g':cout<<"go";break; //g == green
}
}
*******************************************************
do ...... while
#include<iostream.h>
void main()
{
int flag,list[5]={11,31,3,2,98},t,i=0,half;
half=(1+5)/2;
do
{
do
{
flag=0;
for(i=0;i<=4-half;++i)
if(list[i]>list[i+half])
{
t=list[i];
list[i]=list[i+half];
list[i+half]=t;
flag=1;
}
}
while(flag!=0);
half=half/2;
}
while(half!=0);
for(i=0;i<=4;++i)
cout<<list[i]<<"\t";
}
void main()
{
int flag,list[5]={11,31,3,2,98},t,i=0,half;
half=(1+5)/2;
do
{
do
{
flag=0;
for(i=0;i<=4-half;++i)
if(list[i]>list[i+half])
{
t=list[i];
list[i]=list[i+half];
list[i+half]=t;
flag=1;
}
}
while(flag!=0);
half=half/2;
}
while(half!=0);
for(i=0;i<=4;++i)
cout<<list[i]<<"\t";
}
*******************************************************
for
#include<iostream.h>
void main()
{
int j,i,list[5]={12,64,2,75,100},n=5,t;
for(i=0;i<=n-2;++i)
for(j=i+1;j<=n-1;++j)
if(list[i]>list[j])
{
t=list[i];
list[i]=list[j];
list[j]=t;
}
for(j=0;j<=4;++j)
cout<<list[j]<<"\t";
}
void main()
{
int j,i,list[5]={12,64,2,75,100},n=5,t;
for(i=0;i<=n-2;++i)
for(j=i+1;j<=n-1;++j)
if(list[i]>list[j])
{
t=list[i];
list[i]=list[j];
list[j]=t;
}
for(j=0;j<=4;++j)
cout<<list[j]<<"\t";
}
*******************************************************
if
if
#include<iostream.h>
void main()
{
int cpu,fr=10;
cin>>cpu;
if(cpu>=fr)
cout<<"go to memory";
else
cout<<"interrupt";
}
void main()
{
int cpu,fr=10;
cin>>cpu;
if(cpu>=fr)
cout<<"go to memory";
else
cout<<"interrupt";
}
*******************************************************
while
do Example
/* This example prompts users for a password */
/* and continued to prompt them until they */
/* enter one that matches the value stored in */
/* checkword. */
/* and continued to prompt them until they */
/* enter one that matches the value stored in */
/* checkword. */
#include <stdio.h>
#include <string.h>
#include <string.h>
int main ()
{
char checkword[80] = "password";
char password[80] = "";
{
char checkword[80] = "password";
char password[80] = "";
do {
printf ("Enter password: ");
scanf("%s", password);
} while (strcmp(password, checkword));
printf ("Enter password: ");
scanf("%s", password);
} while (strcmp(password, checkword));
return 0;
}
}
*******************************************************
TRIAN برنامج المثلث
#include <iostream.h>
#include <conio.h>
class x
{
private:
int h;
int b;
public:
void initialization();
void printarea();
float area();
int geth();
int getb();
};
void x::initialization()
{
cout << "enter h";
cin >> h;
cout << "enter b";
cin >> b;
}
int x:: geth()
{
return(h);
}
int x::getb()
{
return(b);
}
float x::area()
{
return (b/2.0)*h;
}
void x::printarea()
{
cout << " The hieght = " << geth() << endl;
cout << " The Base = " << getb() << endl;
cout << " The Area = " << area() << endl;
}
main ()
{
x y;
clrscr();
y.initialization();
y.printarea();
getch();
return(0);
}
#include <conio.h>
class x
{
private:
int h;
int b;
public:
void initialization();
void printarea();
float area();
int geth();
int getb();
};
void x::initialization()
{
cout << "enter h";
cin >> h;
cout << "enter b";
cin >> b;
}
int x:: geth()
{
return(h);
}
int x::getb()
{
return(b);
}
float x::area()
{
return (b/2.0)*h;
}
void x::printarea()
{
cout << " The hieght = " << geth() << endl;
cout << " The Base = " << getb() << endl;
cout << " The Area = " << area() << endl;
}
main ()
{
x y;
clrscr();
y.initialization();
y.printarea();
getch();
return(0);
}
*******************************************************
TRIAN
TRIAN
#include <iostream.h>
#include <conio.h>
class x
{
private:
int h;
int b;
public:
void initialization();
void printarea();
float area();
int geth();
int getb();
};
void x::initialization()
{
cout << "enter h";
cin >> h;
cout << "enter b";
cin >> b;
}
int x:: geth()
{
return(h);
}
int x::getb()
{
return(b);
}
float x::area()
{
return (b/2.0)*h;
}
void x::printarea()
{
cout << " The hieght = " << geth() << endl;
cout << " The Base = " << getb() << endl;
cout << " The Area = " << area() << endl;
}
main ()
{
x y;
clrscr();
y.initialization();
y.printarea();
getch();
return(0);
}
#include <conio.h>
class x
{
private:
int h;
int b;
public:
void initialization();
void printarea();
float area();
int geth();
int getb();
};
void x::initialization()
{
cout << "enter h";
cin >> h;
cout << "enter b";
cin >> b;
}
int x:: geth()
{
return(h);
}
int x::getb()
{
return(b);
}
float x::area()
{
return (b/2.0)*h;
}
void x::printarea()
{
cout << " The hieght = " << geth() << endl;
cout << " The Base = " << getb() << endl;
cout << " The Area = " << area() << endl;
}
main ()
{
x y;
clrscr();
y.initialization();
y.printarea();
getch();
return(0);
}
*******************************************************
RNUM
#include <iostream.h>
class RNum {
private:
int a,b;
public:
void assign(int,int);
double convert();
void invert();
void print();
};
class RNum {
private:
int a,b;
public:
void assign(int,int);
double convert();
void invert();
void print();
};
void RNum::assign(int num, int denum)
{
a= num;
b=denum;
}
double RNum::convert()
{
return double(a)/b;
}
{
return double(a)/b;
}
void RNum::invert()
{
int t=a;
a=b;
b=t;
}
{
int t=a;
a=b;
b=t;
}
void RNum::print()
{
cout<<a<<'/'<<b;
}
main()
{
RNum r;
r.assign(36,5);
cout<<"r=";
r.print();
cout<<" = "<<r.convert()<<endl;
r.invert();
cout<<"1/r=";
r.print();
cout<<endl;
int p;
return(0);'
}
{
cout<<a<<'/'<<b;
}
main()
{
RNum r;
r.assign(36,5);
cout<<"r=";
r.print();
cout<<" = "<<r.convert()<<endl;
r.invert();
cout<<"1/r=";
r.print();
cout<<endl;
int p;
return(0);'
}
*******************************************************
PROP1
PROP1
#include <iostream.h>
#include <conio.h>
class property {
private:
float area;
float monthrentval;
float price;
public:
property(float sz,float rent,float prc);
~property();
float increase_rent(float incr);
float decrease_rent(float decr);
float increase_price(float incr);
float decrease_price(float decr);
float yearly_rent();
float get_price();
float get_area();
float get_monthrent();
};
#include <conio.h>
class property {
private:
float area;
float monthrentval;
float price;
public:
property(float sz,float rent,float prc);
~property();
float increase_rent(float incr);
float decrease_rent(float decr);
float increase_price(float incr);
float decrease_price(float decr);
float yearly_rent();
float get_price();
float get_area();
float get_monthrent();
};
float property::increase_rent(float incr)
{
monthrentval +=incr;
return monthrentval;
}
{
monthrentval +=incr;
return monthrentval;
}
float property::decrease_rent(float decr)
{
if(decr<=monthrentval)
{
monthrentval -=decr;
return monthrentval;
}
else return 0.0;
}
float property::increase_price(float amt)
{
price +=amt;
return price;
}
{
price +=amt;
return price;
}
float property::decrease_price(float amt)
{
price -=amt;
return price;
}
{
price -=amt;
return price;
}
float property::yearly_rent()
{
return 12*monthrentval;
}
{
return 12*monthrentval;
}
float property::get_price()
{
return price;
}
float property::get_area()
{
return area;
}
float property::get_monthrent()
{
return monthrentval;
}
property::property(float sz,float rent, float prc)
{
area = sz;
monthrentval = rent;
price = prc;
}
property::~property()
{
}
main()
{
char ch,c;
int m;
{
char ch,c;
int m;
property villa(150.0,100.0,250.0);
property apartment(200.0,100.0,400.0);
property land(300.0,100.0,500.0);
property house(500.0,150.0,600.0);
property apartment(200.0,100.0,400.0);
property land(300.0,100.0,500.0);
property house(500.0,150.0,600.0);
do
{
clrscr();
cout << "1- Increase Rent\n" ;
cout << "2- Decrease rent\n";
cout << "3- Increase Price\n";
cout << "4- Decrease price\n";
cout << "5- Print Yearly Rent\n";
cout << "6- Print area\n";
cout << "7- print Monthly Rent\n";
cout << "8- print Price\n";
cout << "9- Exit\n";
cin >> ch;
{
clrscr();
cout << "1- Increase Rent\n" ;
cout << "2- Decrease rent\n";
cout << "3- Increase Price\n";
cout << "4- Decrease price\n";
cout << "5- Print Yearly Rent\n";
cout << "6- Print area\n";
cout << "7- print Monthly Rent\n";
cout << "8- print Price\n";
cout << "9- Exit\n";
cin >> ch;
switch (ch)
{
case '1' : cout << "Enter Amount Of increase " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.increase_rent(m); break;
case '2' : apartment.increase_rent(m); break;
case '3' : house.increase_rent(m); break;
case '4' : land.increase_rent(m); break;
}
break;
case '2' : cout << "Enter Amount Of decrease " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.decrease_rent(m); break;
case '2' : apartment.decrease_rent(m); break;
case '3' : house.decrease_rent(m); break;
case '4' : land.decrease_rent(m); break;
}
break;
case '3' : cout << "Enter Amount Of increase " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.increase_price(m); break;
case '2' : apartment.increase_price(m); break;
case '3' : house.increase_price(m); break;
case '4' : land.increase_price(m); break;
}
break;
case '4' : cout << "Enter Amount Of decrease " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.decrease_price(m); break;
case '2' : apartment.decrease_price(m); break;
case '3' : house.decrease_price(m); break;
case '4' : land.decrease_price(m); break;
}
break;
case '5' : cout << " The Yearly Rent = " << endl;
cout << " Villa => " << villa.yearly_rent() <<endl;
cout << " The apartment => " << apartment.yearly_rent() << endl;
cout << " house => " << house.yearly_rent() <<endl;
cout << " land => " << land.yearly_rent() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '6' : cout << " The Area = " << endl;
cout << " Villa => " << villa.get_area() <<endl;
cout << " The apartment => " << apartment.get_area() << endl;
cout << " house => " << house.get_area() <<endl;
cout << " land => " << land.get_area() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '7' : cout << " The Monthly Rent = " << endl;
cout << " Villa => " << villa.get_monthrent() <<endl;
cout << " The apartment => " << apartment.get_monthrent() << endl;
cout << " house => " << house.get_monthrent() <<endl;
cout << " land => " << land.get_monthrent() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '8' : cout << " The Price : " << endl;
cout << " Villa => " << villa.get_price() <<endl;
cout << " The apartment => " << apartment.get_price() << endl;
cout << " house => " << house.get_price() <<endl;
cout << " land => " << land.get_price() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
default : break;
}
}
while (ch != '9' );
return(0);
}
{
case '1' : cout << "Enter Amount Of increase " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.increase_rent(m); break;
case '2' : apartment.increase_rent(m); break;
case '3' : house.increase_rent(m); break;
case '4' : land.increase_rent(m); break;
}
break;
case '2' : cout << "Enter Amount Of decrease " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.decrease_rent(m); break;
case '2' : apartment.decrease_rent(m); break;
case '3' : house.decrease_rent(m); break;
case '4' : land.decrease_rent(m); break;
}
break;
case '3' : cout << "Enter Amount Of increase " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.increase_price(m); break;
case '2' : apartment.increase_price(m); break;
case '3' : house.increase_price(m); break;
case '4' : land.increase_price(m); break;
}
break;
case '4' : cout << "Enter Amount Of decrease " << endl;
cin >> m;
cout << "1- villa 2- apartment 3- house 4- land " << endl;
cin >> c;
switch (c)
{
case '1' : villa.decrease_price(m); break;
case '2' : apartment.decrease_price(m); break;
case '3' : house.decrease_price(m); break;
case '4' : land.decrease_price(m); break;
}
break;
case '5' : cout << " The Yearly Rent = " << endl;
cout << " Villa => " << villa.yearly_rent() <<endl;
cout << " The apartment => " << apartment.yearly_rent() << endl;
cout << " house => " << house.yearly_rent() <<endl;
cout << " land => " << land.yearly_rent() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '6' : cout << " The Area = " << endl;
cout << " Villa => " << villa.get_area() <<endl;
cout << " The apartment => " << apartment.get_area() << endl;
cout << " house => " << house.get_area() <<endl;
cout << " land => " << land.get_area() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '7' : cout << " The Monthly Rent = " << endl;
cout << " Villa => " << villa.get_monthrent() <<endl;
cout << " The apartment => " << apartment.get_monthrent() << endl;
cout << " house => " << house.get_monthrent() <<endl;
cout << " land => " << land.get_monthrent() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
case '8' : cout << " The Price : " << endl;
cout << " Villa => " << villa.get_price() <<endl;
cout << " The apartment => " << apartment.get_price() << endl;
cout << " house => " << house.get_price() <<endl;
cout << " land => " << land.get_price() <<endl;
cout << "Press any key to continue" << endl;
getch();
break;
default : break;
}
}
while (ch != '9' );
return(0);
}
out << " house => " << house.get_area() <<endl;
cout << " land => " << land.get_area(
***********************************************
للتحميل
" هنــــــــــــــــا "
cis, do ...... while, while, برامج برمجة 1, برامج وملفات c++ جاهزة للتحميل, برمجة (1), برمجة 1, تخصص أنظمة المعلومات الحاسوبية, تخصص أنظمة المعلومات الحاسوبية - جامعة القدس المفتوحة, تخصص التكنولوجيا, تعلم البرمجة 1, تعلم برامج البرمجة والتكنولوجيا, دروس تخصص التكنولوجيا أنظمة المعلومات الحاسوبية, شرح بالفيديو لبرامج تخصص التكنولوجيا, شرح د.سهى الأعرج وأنور عكاشة, شرح دروس بالفديو لتخصص أنظمة المعلومات الحاسوبية, مع الدكتور أ.زكريا الكيالي, مقررات تخصص أنظمة المعلومات الحاسوبية فرع برنامج التكنولوجيا و الاتصالات, مقررات وكتب تخصص أنظمة المعلومات الحاسوبية تكنولوجيا المعلومات والاتصالات, ملفات وتطبيقات وبرامج جاهزة للتحميل جزء ( 3 ) | برمجة 1,
اطرح اي سؤال خاص بالموضوع في التعليقات