‏إظهار الرسائل ذات التسميات سي بلس بلس. إظهار كافة الرسائل
‏إظهار الرسائل ذات التسميات سي بلس بلس. إظهار كافة الرسائل
مشروع إدارة مدرسة بلغة #C مفتوح المصدر (كود متكامل)

برنامج إدارة مدرسة مشاريع بلغة #C مفتوحة المصدر



ملف المشروع في صندوق الوصف للفيديو على اليوتيوب

مشاهدة المزيد

مشروع متكامل لإدارة الموظفين في لغة ++c -مشاريع بلغة c++


مشروع متكامل لإدارة الموظفين في لغة ++c
Employee’s Management System

شرح المشروع :-

هذا المشروع يقوم او يحتوي على المهام التالية:

1- اضافة عدد n من سجلات الموظفين  واسم الدالة هي ()build
2- طباعه سجلات كافة الموظفين واسم الدالة هي ()list
3- اضافة سجل واحد من الموظفين واسم الدالة هي ()insert
4- حذف سجل معين من سجلات الموظفين واسم الدالة هي ()deletes
5- تعديل سجلات الموظفين واسم الدالة هي ()edit وفي هذه الدالة هنالك دوال اخرى مرتبطة بها ,وهذه الدوال كتالي:

- داله editname والتي تقوم بتعديل اسم الموظف فقط.
- داله editcode والتي تقوم بتعديل كود الموظف فقط.
- داله editexp والتي تقوم بتعديل سنين الخبرة للموظف فقط.
- داله editage والتي تقوم بتعديل عمر الموظف فقط.
- داله editdes والتي تقوم بتعديل تأريخ تعيين الموظف فقط.

6- البحث عن الموظفين واسم الدالة هي ()search .
6- ترتيب الموظفين واسم الدالة هي ()sort هذه الدالة هنالك دوال اخرى مرتبطة بها مثل دالة ()edit
-ترتيب حسب الاسم
-ترتيب حسب العمر
-ترتيب حسب سنين الخبر
-ترتيب حسب الكود
الخ


كود البرنامج

#include <iostream>
#include <windows.h>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <conio.h>
#include <ctime>
#include <dos.h>
#include <iomanip>

#define max 20

using namespace std;

struct employee

{

 char name[20];

 long int code;

 char designation[20];

 int exp;

 int age;

};

int num;

employee emp[max],tempemp[max],sortemp[max],sortemp1[max];

int main()

{

 system("cls");

 void build();

 void list();

 void insert();

 void deletes();

 void edit();

 void search();

 void sort();

 char option;

 void menu();

 menu();

 while((option=cin.get())!='e')

 {

  switch(option)

  {

   case '1':

         build();

         break;

   case '2':

         list();

         break;

   case '3':

         insert();

         break;

   case '4':

         deletes();

         break;

   case '5':

       edit();

        break;

   case '6':

        search();

        break;

   case '7':

         sort();

         break;

  }

   menu();

  }

  return 0;

 }

 void menu()

 {

  system("cls");

 // highvideo();

cout<<"          ";

printf("\n*****  Employees Management System 1.0 ***** ");



//normvideo();

cout<<endl;

cout<<"             ";

cout<<"\n\t\t Press  1---->Insert Many Records Of Employees  ";

cout<<"             ";

cout<<"\n\t\t Press  2---->Print List Of The Employee Records  ";

cout<<"             ";

cout<<"\n\t\t Press  3---->Insert New Employee        ";

cout<<"             ";

cout<<"\n\t\t Press  4---->Delete An Employee Record         ";

cout<<"             ";

cout<<"\n\t\t Press  5---->Edit An Employee Record           ";

cout<<"             ";

cout<<"\n\t\t Press  6---->Search for Employee          ";

cout<<"             ";

cout<<"\n\t\t Press  7---->Sort The List Of Employee          ";

cout<<"             ";

cout<<"\n\t\t Press  e---------->Exit Program              ";

cout<<"             ";

cout<<"\n\n \t\t Select Your Option Please ====> ";

}

// داله اضافة عدد من  الموظفين
void build()

{


 system("cls");

// highvideo();

 printf("Build The Table");

 cout<<endl;

 //normvideo();
 //عدد السجلات التي تريد ادخالها
 cout<<"maximum number of entries  -----  >  20"<<endl;

 cout<<"how many do you want    ----->";

 cin>>num;

 cout<<"Enter The Following Items"<<endl;

 for(int i=0;i<=num-1;i++)

 {

  cout<<" Name  ";

  cin>>emp[i].name;

  cout<<"Code  ";

  cin>>emp[i].code;

  cout<<"Designation  ";

  cin>>emp[i].designation;

  cout<<"Years of Experience  ";

  cin>>emp[i].exp;

  cout<<"Age  ";

  cin>>emp[i].age;

 }

  cout<<"going to main menu";

 Sleep(500);

}

//  داله طباعه كافة الموظفين
void  list()

{

 system("cls");

// highvideo();

 printf("       ********List The Table********");

 cout<<endl;

 //normvideo();

 cout<<"     Name     Code     Designation     Years(EXP)     Age "<<endl;

 cout<<"    ------------------------------------------------------"<<endl;

 for(int i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<emp[i].name;

  cout<<setw(6)<<emp[i].code;

  cout<<setw(15)<<emp[i].designation;

  cout<<setw(10)<<emp[i].exp;

  cout<<setw(15)<<emp[i].age;

  cout<<endl;

 }

  cout<<"going to main menu";

 getch();

  }
// داله اضافة واحد من  الموظفين
  void insert()

  {

  system("cls");

  int i=num;

  num+=1;

 // highvideo();

  printf("Insert New Record");

  cout<<endl;

  //normvideo();

  cout<<"Enter The Following Items"<<endl;

  cout<<"Name  ";

  cin>>emp[i].name;

  cout<<"Code  ";

  cin>>emp[i].code;

  cout<<"Designation  ";

  cin>>emp[i].designation;

  cout<<"Years of Experience  ";

  cin>>emp[i].exp;

  cout<<"Age  ";

  cin>>emp[i].age;

  cout<<endl<<endl;

  cout<<"going to main menu";

 Sleep(500);


  }


// داله حذف  الموظفين
  void deletes()

  {

   system("cls");

  // highvideo();

   int code;

   int check;

   printf("Delete An Entry");

   //normvideo();

   cout<<endl;

   cout<<"Enter An JobCode To Delete That Entry  ";

   cin>>code;

   int i;

   for(i=0;i<=num-1;i++)

   {

    if(emp[i].code==code)

    {

      check=i;

    }

   }

   for(i=0;i<=num-1;i++)

   {

    if(i==check)

    {

    continue;

    }

    else

    {

    if(i>check)

    {

     tempemp[i-1]=emp[i];

    }

    else

    {

     tempemp[i]=emp[i];

    }

     }

   }

  num--;


  for(i=0;i<=num-1;i++)

  {

   emp[i]=tempemp[i];

  }

 }

// داله تعديل سجلات  الموظفين
void edit()

{

 system("cls");

 int jobcode;

// highvideo();

 printf("          Edit An Entry           ");

 cout<<endl;

 cout<<endl;

 int i;

 void editmenu();

 void editname(int);

 void editcode(int);

 void editdes(int);

 void editexp(int);

 void editage(int);

 char option;

 //normvideo();

 cout<<"Enter An jobcode To Edit An Entry----  ";

 cin>>jobcode;

  editmenu();

 for(i=0;i<=num-1;i++)

   {

    if(emp[i].code==jobcode)

    {


while((option=cin.get())!='q')

{

      switch(option)

      {

       case 'n':

            editname(i);

            break;

       case 'c':

            editcode(i);

            break;

       case 'd':

            editdes(i);

            break;

       case 'e':

            editexp(i);

            break;

       case 'a':

           editage(i);

           break;

     }

   editmenu();

    }

  }

  }

  }

  void editmenu()

  {

   system("cls");

   cout<<"        What Do You Want To edit";

   cout<<"          n--------->Name ";

   cout<<"          c--------->Code ";

   cout<<"          d--------->Designation";

   cout<<"          e--------->Experience ";

   cout<<"          a--------->Age        ";

   cout<<"              q----->QUIT                            ";

   cout<<"   Options Please ---->>>  ";

  }

  void editname(int i)

  {

     cout<<"Enter New Name----->  ";

     cin>>emp[i].name;

  }

  void editcode(int i)

  {

   cout<<"Enter New Job Code----->  ";

   cin>>emp[i].code;

  }

  void editdes(int i)

  {

   cout<<"enter new designation----->  ";

   cin>>emp[i].designation;

  }

  void editexp(int i)

  {

   cout<<"Enter new Years of Experience";

   cin>>emp[i].exp;

  }

  void editage(int i)

  {

   cout<<"Enter new Age ";

   cin>>emp[i].age;

  }

// داله البحث عن الموظفين
void search()

{

 system("cls");

 // highvideo();

  printf("Welcome To Search Of Employee Database ");

  //normvideo();

  cout<<endl;

  cout<<endl;

  int jobcode;

  cout<<"You Can Search Only By Jobcode Of An Employee";

  cout<<"Enter Code Of An Employee                    ";

 cin>>jobcode;

 for(int i=0;i<=num-1;i++)

   {

    if(emp[i].code==jobcode)

    {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

  cout<<setw(13)<<emp[i].name;

  cout<<setw(6)<<emp[i].code;

  cout<<setw(15)<<emp[i].designation;

  cout<<setw(10)<<emp[i].exp;

  cout<<setw(15)<<emp[i].age;

  cout<<endl;

 }


  }

    cout<<"going to main menu";

 getch();



}

// داله ترتيب الموظفين
void sort()

{

 system("cls");

// highvideo();

 printf("Sort The Databse By JobCode");

 //normvideo();

 void sortmenu();

 void sortname();

 void sortcode();

 void sortdes();

 void sortexp();

 char option;

 void sortage();


 cout<<endl;

 cout<<endl;

 sortmenu();

 while((option=cin.get())!='q')

 {

  switch(option)

  {

   case 'n':

          sortname();

          break;

   case 'c':

          sortcode();

          break;

   case 'd':

          sortdes();

          break;

   case 'e':

          sortexp();

          break;

   case 'a':

          sortage();

          break;

   }

   sortmenu();

  }

 }



 void sortmenu()

 {

    system("cls");

   cout<<"          What Do You Want To edit";

   cout<<"          n--------->Name         ";

   cout<<"          c--------->Code         ";

   cout<<"          d--------->Designation  ";

   cout<<"          e--------->Experience   ";

   cout<<"          a--------->Age          ";

   cout<<"                               q----->QUIT            ";

   cout<<"   Options Please ---->>>  ";  }



// داله ترتيب الموظفين حسب الاسم
void sortname()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(strcmp(sortemp1[i].name,sortemp1[j].name)<=0)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }


void sortcode()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].code<sortemp1[j].code)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"     ------------------------------------------------------                                  ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }



void sortdes()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(strcmp(sortemp1[i].designation,sortemp1[j].designation)<=0)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age";

 cout<<"     ------------------------------------------------------                                 ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }


void sortage()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].age<sortemp1[j].age)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age";

 cout<<"     ------------------------------------------------------                                 ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }



void sortexp()

{

 system("cls");

 int i,j;

 struct employee temp[max];

 for(i=0;i<=num-1;i++)

 {

  sortemp1[i]=emp[i];

 }

 for(i=0;i<=num-1;i++)

  {

   for(j=0;j<=num-1;j++)

   {

    if(sortemp1[i].exp<sortemp1[j].exp)

    {

     temp[i]=sortemp1[i];

     sortemp1[i]=sortemp1[j];

     sortemp1[j]=temp[i];

    }

   }

 }


 for( i=0;i<=num-1;i++)

   {


    cout<<"     Name     Code     Designation     Years(EXP)     Age ";

 cout<<"  ------------------------------------------------------ ";

 for( i=0;i<=num-1;i++)

 {

  cout<<setw(13)<<sortemp1[i].name;

  cout<<setw(6)<<sortemp1[i].code;

  cout<<setw(15)<<sortemp1[i].designation;

  cout<<setw(10)<<sortemp1[i].exp;

  cout<<setw(15)<<sortemp1[i].age;

  cout<<endl;

 }

  cout<<"Press Any Key To Go Back";

 getch();


} }

مشاهدة المزيد

برامج متكامله بلغة c++ - مشروع تسويق متكامل بلغة c++

مشروع تسويق متكامل بلغة c++

مهام المشروع:

1- ادارة المخزن 

- ادخال سلع جديده
- بحث عن سلعة معينه
- تعديل سلعه معين
- حذف سعله معينة
- طباعه تقرير لكافة السلع

2- بيع سلعه او منتج معين

حفظ كافة السجلات الى ملف خارجي  dat.


كود المشروع

#include <iostream>
#include <windows.h>
#include <fstream>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <conio.h>
#include <ctime>
#include <dos.h>
#include <iomanip>
using namespace std;
COORD coord = {0, 0};
void gotoxy(int x, int y)
{
 COORD coord;
 coord.X = x;
 coord.Y = y;
 SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coord);
}
class product
{
int pno;
char name[50];
float price,qty,tax,quant;
public:
void create_product()
{

cout<<"\nPlease Enter The Product No: ";
cin>>pno;
cout<<"\n\nPlease Enter The Name of The Product: ";
cin>>name;
cout<<"\nPlease Enter The Price of The Product: ";
cin>>price;
cout<<"\nPlease Enter The Quantity:  ";
cin>>quant;
}
void show_product()
{

cout<<"\t\t"<<pno<<" \t"<<name<<"\t"<<price<<"\t"
         <<quant<<"\n";

}
int retpno()
{return pno;}
float retprice()
{return price;}
char* retname()
{return name;}
int retquant()
{return quant;}
}; 
//class ends 

//***************************************************************
// global declaration for stream object, object
//****************************************************************
fstream fp;
product pr;
//***************************************************************
// function to write in file
//****************************************************************
void write_product()
{
fp.open("Shop.dat",ios::out|ios::app);
pr.create_product();
fp.write((char*)&pr,sizeof(product));
fp.close();
cout<<"\n\nThe Product Has Been Created ";
getch();
}
//***************************************************************
// function to read all records from file
//****************************************************************
void display_all()
{
system("cls");
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
cout<<"\n\t\tID"<<" \t"<<"Name"<<"\t"<<"Price"<<"\t"
         <<"quantity"<<"\n";
cout<<"\t\t----------------------------------------\n\n";
fp.open("Shop.dat",ios::in);
while(fp.read((char*)&pr,sizeof(product)))
{
pr.show_product();
cout<<"\n\n\t\t====================================\n";
getch();
}
fp.close();
getch();
}
//***************************************************************
// function to read specific record from file
//****************************************************************
void display_sp(int n)
{
int flag=0;
fp.open("Shop.dat",ios::in);
while(fp.read((char*)&pr,sizeof(product)))
{
if(pr.retpno()==n)
{
system("cls");
pr.show_product();
flag=1;
}
}
fp.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}


//***************************************************************
// function to place order and generating bill for Products
//****************************************************************
void place_order(){

int pno,quan,c=0,discount=0;
double amt,damt,total=0;
int flag=0;
char ch='Y';

cout<<"\n\t\t\t============================";
cout<<"\n\t\t\t     PLACE YOUR ORDER";
cout<<"\n\t\t\t============================\n";

cout<<"\n\nEnter The Product No. Of The Product : ";
cin>>pno;
cout<<"\nQuantity in number : ";
cin>>quan;

cout<<"\Enter The discount : ";
cin>>discount;
//c++;

cout<<"\n\nThank You For Placing The Order";getch();system("cls");
cout<<"\n\n\t  ************************INVOICE************************\n\n";

fp.open("Shop.dat",ios::in);
while(fp.read((char*)&pr,sizeof(product)))
{
if(pr.retpno()==pno)
{
//system("cls");
pr.show_product();
flag=1;

amt=pr.retprice()*quan;
damt=amt-(amt*discount/100);
cout<<"\nID\tPr Name\tQuantity\tPrice \tAmount \tThe final price after discount\n";

cout<<"\n\n"<<pno<<"\t"<<pr.retname()
<<"\t"<<quan<<"\t\t"<<pr.retprice()<<"\t"<<amt<<"\t\t"<<damt<<"\n";
total+=damt;

}

}
cout<<"\n\t\tTOTLE:"<<total<<"\n\n";



fp.close();
if(flag==0)
cout<<"\n\nrecord not exist";
getch();
}
//***************************************************************
// function to modify record of file
//****************************************************************
void modify_product()
{
int no,found=0;
system("cls");
cout<<"\n\n\tTo Modify ";
cout<<"\n\n\tPlease Enter The Product No. of The Product";
cin>>no;
fp.open("Shop.dat",ios::in|ios::out);
while(fp.read((char*)&pr,sizeof(product)) && found==0)
{
if(pr.retpno()==no)
{
pr.show_product();
cout<<"\nPlease Enter The New Details of Product"<<endl;
pr.create_product();
int pos=-1*sizeof(pr);
fp.seekp(pos,ios::cur);
fp.write((char*)&pr,sizeof(product));
cout<<"\n\n\t Record Updated";
found=1;
}
}
fp.close();
if(found==0)
cout<<"\n\n Record Not Found ";
getch();
}
//***************************************************************
// function to delete record of file
//****************************************************************
void delete_product()
{
int no;
system("cls");
cout<<"\n\n\n\tDelete Record";
cout<<"\n\nPlease Enter The product no. of The Product You Want To Delete";
cin>>no;
fp.open("Shop.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
fp.seekg(0,ios::beg);
while(fp.read((char*)&pr,sizeof(product)))
{
if(pr.retpno()!=no)
{
fp2.write((char*)&pr,sizeof(product));
}
}
fp2.close();
fp.close();
remove("Shop.dat");
rename("Temp.dat","Shop.dat");
cout<<"\n\n\tRecord Deleted ..";
getch();
}
//***************************************************************
// function to display all products price list
//****************************************************************
void menu()
{
system("cls");
fp.open("Shop.dat",ios::in);
if(!fp)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to create File";
cout<<"\n\n\n Program is closing ....";
getch();
exit(0);
}
cout<<"\n\n\t\tProduct MENU\n\n";
cout<<"====================================================\n";
cout<<"P.NO.\t\tNAME\t\tPRICE\t   Quantity\n";
cout<<"====================================================\n";
while(fp.read((char*)&pr,sizeof(product)))
{
cout<<pr.retpno()<<"\t\t"<<pr.retname()<<"\t\t"<<pr.retprice()<<"\t\t"<<pr.retquant()<<"\n\n";
}
fp.close();
}

//***************************************************************
// INTRODUCTION FUNCTION
//****************************************************************
void intro()
{
system("cls");
gotoxy(31,11);
cout<<"SUPER MARKET";
gotoxy(35,14);
cout<<"BILLING";
gotoxy(35,17);
cout<<"PROJECT";
cout<<"\n\nMADE BY : ODAI DAMMAG";

getch();
}

//***************************************************************
// ADMINSTRATOR MENU FUNCTION
//****************************************************************
void admin_menu()
{
system("cls");
int ch2;
cout<<"\n\n\n\tADMIN MENU";
cout<<"\n\n\t1.CREATE PRODUCT";
cout<<"\n\n\t2.DISPLAY ALL PRODUCTS";
cout<<"\n\n\t3.QUERY ";
cout<<"\n\n\t4.MODIFY PRODUCT";
cout<<"\n\n\t5.DELETE PRODUCT";
cout<<"\n\n\t6.VIEW PRODUCT MENU";
cout<<"\n\n\t7.BACK TO MAIN MENU";
cout<<"\n\n\tPlease Enter Your Choice (1-7) ";
//ch2=getche();
cin>>ch2;
switch(ch2)
{
case 1: system("cls");
write_product();
break;
case 2: 
 
display_all();
break;
case 3:
int num;
system("cls");
cout<<"\n\n\tPlease Enter The Product No. ";
cin>>num;
display_sp(num);
break;
case 4: modify_product();break;
case 5: delete_product();break;
case 6: menu();
getch();break;
case 7: break;
default:cout<<"\a";admin_menu();
}
}
//***************************************************************
// THE MAIN FUNCTION OF PROGRAM
//****************************************************************
void main()
{
char ch;
intro();
do
{
system("cls");
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. CUSTOMER";
cout<<"\n\n\t02. ADMINISTRATOR";
cout<<"\n\n\t03. EXIT";
cout<<"\n\n\tPlease Select Your Option (1-3) ";
//ch=getche();
cin>>ch;
switch(ch)
{
case '1': system("cls");
place_order();
getch();
break;
case '2': admin_menu();
break;
case '3':exit(0);
default :cout<<"\a";
}
}while(ch!='3');
}
//***************************************************************
// END OF PROJECT
//***************************************************************

اتمنى ان تستفيدوا من هذا المشروع
اخوكم عدي دماج,,,
مشاهدة المزيد

برامج جاهزه بلغة c++ المصفوفات


برنامج بلغة c++ بإستخدام المصفوفات يقوم بالتالي:

1- ايجاد اكبر عدد في المصفوفه

2- ايجاد اصغر عدد في المصفوفه

3- ايجاد او حساب مضروب اكبر عدد في المصفوفه

4- ايجاد اكبر عدد في المصفوفه

5- ايجاد مجموع اعداد المصفوفه

6- ايجاد المتوسط لعناصر المصفوفه

7- ترتيب عناصر المصفوفه

8- ايجاد مضروب مصفوفتين



كود البرنامج




#include<iostream>
#include<string>
using namespace std;

int max_number(int arr[] , int size);
int min_number(int arr[] , int size);
int sum_number(int arr[] , int size);
int avg_number(int arr[] , int size);
void sort_number(int arr[],int size);

void multiply_array(int arr1[],int arr2[]){
int result[5];
int i;
    
    
    for (i = 0; i < 5; i++) {
        result[i] = arr1[i] * arr2[i];
    }

    for (i = 0; i < 5; i++) {
        cout << arr1[i] << " * " << arr2[i] << " = " << result[i] << '\n';
    }


}


int Factorial(int num) {
 int fact=1;

    

    for(int i=1;i<=num;i++)

    {

        fact=fact*i;

    }

return fact;
}

int main(){
int x[5],i;
int user[5], second[5];
int z;
for( i=0;i<5;i++) {

 cout<<"enter number"<<endl;
 cin>>x[i];


    
}

z=max_number(x,5);

cout<<"The max number is" << max_number(x,5)<<endl;
cout<<"FACTORIAL OF MAX NUMBER IS: "<<Factorial(z)<<"\n";
cout<<"The min number is" << min_number(x,5)<<endl; 
cout<<"The Sum of Numbers is" << sum_number(x,5)<<endl; 
cout<<"The avareg is :"<<avg_number(x,5)<<"\n";
 
sort_number(x,5);



     cout<<"=================ARRAY NUMBER 1=======================\n";
    for (int j = 0; j < 5;j++) {
        cout << "Enter value #" << (j + 1) << " : ";
        cin >> user[j];
    }
cout<<"=================ARRAY NUMBER 2=======================\n";
for (int j = 0; j < 5; j++) {
        cout << "Enter value #" << (j + 1) << ":";
        cin >> second[j];
    }

   multiply_array(user,second);




return 0;

}


int max_number(int arr[] , int size)
{
arr[size];
int max=0;
for(int i=0;i<size;i++)
if(arr[i]>max)
max=arr[i];
return max;
}

int min_number(int arr[] , int size){

arr[size];
int min=0;
min=max_number(arr,size);
for(int i=0;i<size;i++)
if(arr[i]<min)
min=arr[i];
return min;
}


int sum_number(int arr[] , int size){

arr[size];
int sum=0;
for(int i=0;i<size;i++)
sum+=arr[i];

return sum;
}

int avg_number(int arr[] , int size){

arr[size];
int sum=0;
for(int i=0;i<size;i++)
sum+=arr[i];
return sum/size;
}

void sort_number(int arr[],int size){
int i,sort_num=0,j;




for(i=0;i<size;i++)
{
for(j=0;j<size-i;j++)
{
if(arr[j]>arr[j+1])
{
sort_num=arr[j];
arr[j]=arr[j+1];
arr[j+1]=sort_num;
}
}
}

//for(j=0;j<size ;j++)
//{
//cout<<arr[j+1]<<"\n";
////}

for(j=size;j>0 ;j--)
{
cout<<arr[j]<<"\n";
}

}

انشاء الله تستفيدوا من هذا البرنامج

م/عدي دماج
مشاهدة المزيد