View Full Version : آموزش: DataBase دانشجویی با ذخیره فایل
farzadxx
دوشنبه 28 دی 1388, 21:56 عصر
سلام این پروژه برنامه نویسی پیشرفته دانشگاهم بود.گفتم بزارم شاید دوستان هم استفاده کنن
پروژه با زبان ++C نوشته شده داخل VisualStudio8 و تحت Console application هستش
(CMD ویندوز)
نام و نام خانوادگی و شماره دانشجویی به همراه نمره چند درس رو میگیره (معدل میده ) و ذخیره می کنه داخل فایل متنی
با دادن شماره دانشجویی می تونید پارامتر های اون دانشجو رو دوباره Edit کنید
قابلیت لیست و اضافه کردن هم داره
با Struct هم نیست.با Class نوشته شده
و از قابلیت های جالبش این که شما با Cursor کیبورد می تونید روی پارامتر های منو بالا پایین کنید
پسورد :
shabgard.org
Source (http://uploading.com/files/cdm225f3/Source.rar/)
rasool&gh
پنج شنبه 01 بهمن 1388, 12:05 عصر
salam bebakshid vali man in kod ro gereftam o tu c++ copy kardam vali 26 ta khata gereft.
jaafar1363
پنج شنبه 01 بهمن 1388, 14:53 عصر
سلام رفیق
می خواستم ببینم مشکل این برنامه چیه؟
-------------------------------------------------------------
#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
struct student{
char name[20];
char family[25];
int id;
student *next;
};
student *first,*last;
//////////////////////////
void input(){
student *temp=new student;
cout<<"plese enter the id : "<<endl;
cin>>temp->id;
cout<<"plese enter the name : "<<endl;
cin>>temp->name;
cout<<"plese enter the family : "<<endl;
cin>>temp->family;
if (first==NULL){
first=last=temp;
}
else {
temp->next=last;
last=temp;
}
}
/////////////////////////////////
void output(){
student *temp=new student;
temp=first;
while(temp!=NULL){
cout<<temp->id<<endl;
cout<<temp->name<<endl;
cout<<temp->family<<endl;
cout<<"*************************************";
temp=temp->next;
}
cout<<"end of record"<<endl;
}
/////////////////////////////////////
void search(int id){
student *temp=new student;
int find;
temp=first;
while(temp!=NULL){
if (id==temp->id){
cout<<temp->id<<endl;
cout<<temp->name<<endl;
cout<<temp->family<<endl;
find=1;
break;
}
else{
find=0;
temp=temp->next;
}
}
if (find==0){ cout<<"not find record"<<endl;}
}
////////////////////////////////////
void main(){
int stat;
for (;;){
system("cls");
cout<<"***************************************"<<endl;
cout<<"num 1 for input data " <<endl;
cout<<"num 2 for list data " <<endl;
cout<<"num 3 for search data " <<endl;
cout<<"num 4 for exit" <<endl;
cout<<"***************************************"<<endl ;
cin>>stat;
system("cls");
switch(stat){
case 1:
input();
break;
case 2:
output();
break;
case 3:
int key;
cout<<"plese enter id for search : " ;
cin>>key;
search(key);
break;
case 4:
exit(0);
}
}
}
------------------------------------------------------------------
دمت گرم
cpp.mfc
شنبه 03 بهمن 1388, 03:06 صبح
سلام
1- بعد ازدستورات پیش پردازنده فضای نام std تعریف نشده ، به صورت زیر تصحیح کنید :
using namespace std ;
2- در خط 68 و 73 دستور endl به صورت اشتباه e ndl نوشته شده :
endl
__________________________________________________ _ برنامه بدون خطا در این پایین :
#include <iostream>
#include <conio.h>
#include <stdlib.h>
using namespace std ;
struct student{
char name[20];
char family[25];
int id;
student *next;
};
student *first,*last;
//////////////////////////
void input(){
student *temp=new student;
cout<<"plese enter the id : "<<endl;
cin>>temp->id;
cout<<"plese enter the name : "<<endl;
cin>>temp->name;
cout<<"plese enter the family : "<<endl;
cin>>temp->family;
if (first==NULL){
first=last=temp;
}
else {
temp->next=last;
last=temp;
}
}
/////////////////////////////////
void output(){
student *temp=new student;
temp=first;
while(temp!=NULL){
cout<<temp->id<<endl;
cout<<temp->name<<endl;
cout<<temp->family<<endl;
cout<<"*************************************";
temp=temp->next;
}
cout<<"end of record"<<endl;
}
/////////////////////////////////////
void search(int id){
student *temp=new student;
int find;
temp=first;
while(temp!=NULL){
if (id==temp->id){
cout<<temp->id<<endl;
cout<<temp->name<<endl;
cout<<temp->family<<endl;
find=1;
break;
}
else{
find=0;
temp=temp->next;
}
}
if (find==0){ cout<<"not find record"<<endl;}
}
////////////////////////////////////
void main(){
int stat;
for (;;){
system("cls");
cout<<"***************************************"<<endl;
cout<<"num 1 for input data " <<endl;
cout<<"num 2 for list data " <<endl;
cout<<"num 3 for search data " <<endl;
cout<<"num 4 for exit" <<endl;
cout<<"***************************************"<<endl ;
cin>>stat;
system("cls");
switch(stat){
case 1:
input();
break;
case 2:
output();
break;
case 3:
int key;
cout<<"plese enter id for search : " ;
cin>>key;
search(key);
break;
case 4:
exit(0);
}
}
}
vBulletin® v4.2.5, Copyright ©2000-1404, Jelsoft Enterprises Ltd.