الفريق العربي للبرمجةأرشيف المنتديات · 2000 – 2023
نسخة أرشيفية للقراءة فقط — التسجيل والمشاركة مغلقان، والمحتوى محفوظ كما كان.

[مخالف - طلب حل : ][مخالف]عايز اعرف الخطأ في الكود التالي

مغلق
بدأه احمد رشوان في 8 يونيو 2008 · 1 رد · 454 مشاهدة · في ارشيف قسم C/C++
مشاركة: واتساب X فيسبوك تيليجرام
#1 صاحب الموضوع

يا اخوان يا افاضل اتمنى منكم معرفة الخطأ في هذا الكود والتعديل عليه اذا ممكن المشروع يخص شركة سيارات بدي اياه بالكلاس اذا امكن

وتفصيل المشروع

المطلوب

1) ادخال سيارات جديدة

2) بحث عن سيارة موجودة في الشركة

البحث بالموديل واللون وقوة المحرك

3) بيع سيارة

ا) بيانات المشتري)الاسم ، العنوان ، رقم الجوال نحدد له رقم

ب) عملية الشراء )بيعت السيارة ام لا ) والسعر وتاريخ الشراء

ملاحظة: اذا تم بيع السيارة تحذف من قاعدة البيانات

4) بحث عن السيارت المباعة

عن طريق كود السيارة

وهذا هو الكود

#include <iostream.h>

#include <process.h>

#include <fstream.h>

struct marks

{

int m1,m2,m3;

};

struct customer

{

char name [30];

long num;

marks course;

};

int i=-1;customer st [10];

fstream stfile;

void insert (customer []);

void searching (customer []);

void sale (customer []);

void searching (customer []);

void main ()

{

int n;

do

{

system("cls");

cout<<endl;

cout<<endl;

cout<<"\t\t_________________________________________________"<<endl;

cout<<"\t\t*\t\t\t\t\t\t*\n";

cout<<"\t\t*\t\t\t\t\t\t*\n";

cout<<"\t\t*\t\t\t\t\t\t*\n";

cout<<"\t\t*\t1.inserting new car : \t\t\t\t*\n\t\t*";

cout<<"\t\t\t\t\t\t*\n";

cout<<"\t\t*\t2.searching car in company : \t\t\t\t*\n\t\t*";

cout<<"\t\t\t\t\t\t*\n";

cout<<"\t\t*\t3.Car sales : \t\t\t\t*\n\t\t*";

cout<<"\t\t\t\t\t\t*\n";

cout<<"\t\t*\t4.searching car sales : \t\t\t\t*\n\t\t*";

cout<<"\t\t\t\t\t\t*\n";

cout<<"\t\t*\t\t\t\t\t\t*\n\t\t*";

cout<<"\t\t\t\t\t\t*\n";

cout<<"\t\t_________________________________________________"<<endl;

cout<<endl;

cout<<"\t\t**********************\n";

cout<<"\t\t* enter the number *\n";

cout<<"\t\t**********************\n";

cout<<"\t\t\t\t\t"; cin>>n;

cin.ignore();

switch(n)

{

case 1:

system("cls");

cout<<endl;

cout<<"to insert data of new car....\n";

insert (st);

break;

case 2:

system("cls");

cout<<endl;

cout<<"to searching on car in the company....\n";

break;

case 3:

system("cls");

cout<<endl;

cout<<"to car sales.....\n";

searching (st);

break;

case 4:

system("cls");

cout<<endl;

cout<<"to searching about car sales.....\n";

default:

system("cls");

cout<<"try again...\n";

break;

}

}

while (n!=6);

}

void insert (customer st[])

{

cout<<"ADD new car :";

}

void searching (customer st[])

{

long y;

cout<<"enter the model and color and no. of engine:";

cin>>y;

system("cls");

for (int j=-1;j<=i;j++)

if (st[j].num==y)

{

cout<<"enter the name of the customer :";

cin>>st[j].name;

cout<<"enter the number of the customer:";

cin>>st[j].num;

cout<<"enter the mark of the logic disign course :";

cin>>st[j].course.m1;

cout<<"enter the mark of the system analysis course :";

cin>>st[j].course.m2;

cout<<"enter the mark of the algorithm analysis course:";

cin>>st[j].course.m3;

}

}

void searching (customer st[])

{

long m;

cout<<"write the number of the customer which looks for it:";

cin>>m;

cin.ignore();

for (int b=-1;b<=i;b++)

if (st.num==m)

{

cout<<"enter the name of the customer :";

cin>>st[j].name;

cout<<"enter the number of the customer:";

cin>>st[j].num;

}

cin.ignore();

}

void searching (customer st[])

{

for (int s=-1;s<=i;s++)

{

if (st.num!=0)

{

cout<<"___________________________________________\n";

cout<<"the name of the customer :"<<st.name<<endl;

cout<<"the number of the customer:"<<st.num<<endl;

}

}

cin.get();

}

void saving (customer [])

{

stfile.open("customer.dat",ios::out|ios::binary);

for (int f=-1;f<i;f++)

{

if (st[f].num!=0)

stfile.write((char*)&st[f],sizeof(st[f]));

}

stfile.close();

}

void reading (customer [])

{

stfile.open("customer.dat",ios::in|ios::binary);

i++;

stfile.read((char*)&st,sizeof(st));

while (!stfile.eof())

{

i++;

stfile.read((char*)&st,sizeof(st));

}

stfile.close();

}

MATRIX

#2

تأسف إدارة الفريق العربي لغلق الموضوع وذلك لمخالفته قوانين المشاركات، فقرة طلب حل الواجبات والتمارين وأعمال السنة.

قواعد طرح المشاركات

/index.php?showtopic=29343

[وسط]

♥ Countess ♥

57899411.gif

♥

[/وسط]

هذا الموضوع مغلق.

مواضيع مشابهة

عدد الزوار حالياً

المتواجدون خلال آخر دقيقتين · يتحدّث كل ٣٠ ثانية

—الإجمالي—أعضاء مسجّلون—زوار بدون تسجيل

جارٍ التحقق من المتواجدين…