مشروع محاسبي ميني ماركت بلغة سي بلس بلس

 مشروع برنامج محاسبي سوبر ماركت

*الهدف من المشروع : *

برنامج محاسبي بحد ذاته ..

- فهو برنامج لتخزين بيانات مشتريات ومبيعات سوبرماركت وطباعتها على شكل جدول باعة ُ و يقوم البرنامج بحساب الكمية الم of quantity sales وثمنها والمتبقية(المشتريات) وثمنها وحساب المتبقي في السوبرماركت ... - كما يقوم هذا البرنامج بحساب صافي الربح وحساب رأس المال capital...

*مزايا برنامج المشروع :

  • سهولة الستخدام من حيث تبويباته وأقسامه.
  • الترابط المحكم بين المشتريات والمبيعات : بحيث إذا زادت كمية المبيعات فإن كمية المشتريات تقل بمقدار كمية المبيعات وبالتالي يزداد ثمن المبيعات بينما يقل ثمن المشتريات مع كل عملية بيع - إمكانية إضافة مشتريات جديدة أو بيع منتجات متى ما أراد المستخدم ذلك.
  • عند البيع يتطلب من المستخدم ادخال كود code المنتج فقط بالضافة إلى سعر البيع والكمية المباعة.
  • عند طباعة البيانات فأنه يطبعها مرتبه على شكل جدول.
  •  بإمكان المستخدم الضافة أو التعديل على بيانات المشتريات , فعند شراء بضاعة جديدة ما على المستخدم سوى إدخال اسم الصنف والكميه وسعر الوحدة الجديد المضافة من هذا الصنف أو النوع.

بالمرفقات تجد صورة توضح طريقة عمل البرنامج  و فيما يلي كود المشروع كاملا:

#include 
#include 
using namespace std;
class supermarket
{
 int code;
 char sortname[30];
 int priceunit;
 int quantity;
 int pricequant;
 public:
 void getdata(long &,int &);
 void printdata();
 int search_code();
 void data_p(int ,char [],int ,int ,long & ,int & );
 friend void relation(supermarket & s, supermarket & a , long &
,long & , int & ,int &,long &);
 void add_data(long &,int &);
 void search_name(char []);
};
int size;
int n=0,m;
void relation(supermarket & s , supermarket & a ,long & totpurch ,
long & totsale,int & all_q_p ,int & all_q_s ,long & s_by_p)
 {

 a.code=s.code;
 cout <<"the code is : "<>a.priceunit;
 cout<<" enter quantity of sort : ";
 cin>>a.quantity;
 a.pricequant=(a.priceunit)*(a.quantity);
 s.quantity=(s.quantity)-(a.quantity);
 s.pricequant=(s.quantity)*(s.priceunit);
 (all_q_s)+=(a.quantity);
 (all_q_p)-=(a.quantity);
 (totpurch)-=(a.quantity)*(s.priceunit);
 (totsale)+=(a.pricequant);
 s_by_p+=(a.quantity)*(s.priceunit);
 if(s.quantity<=10)
 {
 cout <<"\n"<<"\n !!!!!! there are only "<> code;
 cout<<"enter sort-name: ";
 cin >> sortname;
 cout<<"enter price of unit: ";
 cin>>priceunit;
 cout<<"enter quantity : ";
 cin >> quantity;
 pricequant=priceunit*quantity;
 totpurch+=(pricequant);
 all_q_p+=quantity;
 }
void supermarket :: printdata()
 {
 if(pricequant>priceunit;
cout <<"\n enter the new quantity : ";
 cin >>x;
 quantity+=x;
 pricequant= (priceunit)*(quantity);
 totpurch = totpurch - q;
 totpurch+= pricequant;
 all_q_p+=x;

 }
void supermarket :: search_name(char c[])
 {
 strcpy(c , sortname);

 }
int main(int argc, char *argv[])
{
 int j=100;
 int i=3;
 int t=0;
 long totpurch=0,totsale=0,s_by_p=0;
 int all_purch=0 , all_sales=0;
 cout <<" ***** welcome ***** \n\n";
 supermarket s[j],a[j];
 char x[]="milk";
 char y[]="drink";
 char z[]="cola";
 int option=0;
 while(option<=3)
 {
 cout <<" ***** welcome to main list ***** \n\n";
 cout<<"\n";
 cout<<" ** if you want login to purchases part enter number : 1
"<<"\n";
 cout<<" ** if you want login to sales part enter number : 2
"<<"\n";
 cout<<" ** if you want know total quantity and price quantity
and capital for purchases and sales enter : 3 \n";
 cout<<" ** if you want exit from program enter any key > 3 is :
4\n";
 cout<<"\n"<<" enter your option please : ";
 if(t==0)
 {
 s[0].data_p(202,x,150,20,totpurch,all_purch);
 s[1].data_p(303,y,100,30,totpurch,all_purch);
 s[2].data_p(404,z,120,30,totpurch,all_purch);
 t++;
 } 
cin>>option;
 if(option==1)
 {
 cout<<"\n";
 cout<<" \t ***** welcome to purchases patr *****\n"<<"\n";
 int op=0;
 while(op<=3)
 {
 cout <<"if you want get purchases data enter :1\n";
 cout <<"if you want print purchases data enter :2\n";
 cout <<"if you want add new data to eny sort you have it
enter 3 :\n";
 cout <<"if you want go to main list enter :4";
 cout<<"\n enter option :";
 cin >>op;

 if(op==1)
 {
 cout<<"\n";
 cout <<"enter NO. of purchases sorts you want add
them :";
 cin >>size;
 for(int j=i;j<(i+size);j++)
 {
 cout <<"enter data of sort number:"<>q;
 for(int d=0;d>op;
 if(op==1)
 { int pos=-1;
 cout<<"\n*** enter number of all sales sorts ****\n
";
 cin>>n;
 for(int k=0;k>m;
 for(int f=0;f

ابحث عن مسائل برمجة سي بلس بلس | C++ programming بالانجليزي

هل أعجبك المحتوى؟

. . .

هذه المادة الدراسية هي ضمن مكتبة

مكتبة أمثلة وتمارين بلغة سي بلس بلس ++C للمبتدئين

محتاج مساعدة؟ تواصل مع مدرس اونلاين الان!

التعليقات

الكود ناقص

الكود ما يشتغل، ايش الحل؟

الكود ناقص

لاضافة سؤال او تعليق على المشاركة يتوجب عليك تسجيل الدخول
تسجيل الدخول