دوست عزیز، به سایت علمی نخبگان جوان خوش آمدید

مشاهده این پیام به این معنی است که شما در سایت عضو نیستید، لطفا در صورت تمایل جهت عضویت در سایت علمی نخبگان جوان اینجا کلیک کنید.

توجه داشته باشید، در صورتی که عضو سایت نباشید نمی توانید از تمامی امکانات و خدمات سایت استفاده کنید.
صفحه 2 از 19 نخستنخست 123456789101112 ... آخرینآخرین
نمایش نتایج: از شماره 11 تا 20 , از مجموع 188

موضوع: پروژه هاي برنامه نويسي

  1. #11
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    الگوریتم کلی و سورس کامل مثلث n عددی:

    کد PHP:
    #include <iostream.h>
    int cNum (int k)
    {
     
    int val =1;
     while( 
    k/10 )
     {
      
    /=10;
      
    val ++;
     }
     return 
    val;
    }
    int cNumCount (int k)
    {
     
    int val 0;
     for( 
    int i=ki>&& cNum(i)== cNum(k); i--)
       
    val ++;
     return 
    val;
    }
    int main()
    {
     
    int ncbj;
     
    cout<<"\n add ro vared konid >";
     
    cin>>n;
     
    n*2;
     
    1;
     for(
    int i=0;i<n;i++){
       
    cout<<"\n";
       for(
    j=0;j<c-i-cNumCount(b)*(cNum(i)-1);j++)
        
    cout<<" ";
       for( 
    j=1;j<=b;j++)
        
    cout<<j;
       for( 
    j=1;j<i+cNum(i);j++)
        
    cout<<j;
       
    b+=1;
     }
     return 
    0
    }
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  2. 4 کاربر از پست مفید آبجی سپاس کرده اند .


  3. #12
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    برنامه ای که داخل فایل(Data.Txt) کلمه ای رو که بیشترین تکرار رو داشته باشه رو برمیگردونه.
    کد PHP:
         #include "iostream.h"
    #include "stdio.h"
    #include "stdlib.h"
    #include "conio.h"
    void main()
    {
     
    clrscr();
     
    FILE *f1;
     
    struct txt
     
    {
      
    char name[20];
      
    int rep;
      }list[
    10];
      
    f1=fopen("Data.txt","rb");
      for(
    int i=0;i<10;i++)
      list[
    i].rep=0;
      
    int j=0;
      
    char A[20];
      while(
    f1 != NULL && !feof(f1))
      {
       
    fscanf(f1,"%s",&A);           
       for(
    int i=0;i<j;i++)
        if( 
    strcmp(list[i].nameA)==){
         list[
    i].rep++;
         break;
        }else{
         
    strcpy(list[j].nameA);    
         list[
    j].rep 1;
        }
          
    j++;
      }
      
    fclose(f1); 
      
    int max=0;
      for(
    int k=1;k<10;k++)
        if(list[
    k].rep>list[max].rep)
          
    max=k;
      
    cout<<list[max].name;
      
    getch();

    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  4. 3 کاربر از پست مفید آبجی سپاس کرده اند .


  5. #13
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    Ok پاسخ : پروژه هاي برنامه نويسي

    برنامه کاربردی برای آموزش استفاده از فایل و Structها

    کد PHP:
    #include <stdlib.h>
    #include <stdio.h>
    #include <conio.h>
    #include <ctype.h>
    #include <string.h>
    struct address {
           
    char name[30] ;
           
    char street[30] ;
           
    char city[20] ;
           
    char state[3] ;
           
    char zip[10] ;
           
    struct address *next ;
           
    struct address *prior ;
    list_entry ;
    struct address *start ;
    struct address *last ;
    void enter() , display() , search() ;
    void save()  , load()    , list() , del();
    void display(struct address *infoint *row);
    struct address *find(char *);
    int menu_select();
    struct address *store(struct address *, struct address *);
    int main ()
    {
           
    start last NULL ;
           for(;;) {
       switch(
    menu_select()) {
            case 
    1:  enter();  break ;
            case 
    del();    break ;
        case 
    3:  list() ;  break ;
            case 
    4:  search(); break ;
            case 
    5:  save();   break ;
            case 
    6:  load();   break ;
            case 
    7:  exit(0) ;
         }
    //end of switch
           
    }//end of for
    }//end of main
    //****************
    int menu_select()
    {
          
    char s[5];
          
    clrscr() ;
          
    gotoxy(254) ;
          
    printf("1. enter a name ") ;
          
    gotoxy(256) ;
          
    printf("2. delete a name ") ;
          
    gotoxy(258) ;
          
    printf("3. list all files ") ;
          
    gotoxy(2510) ;
          
    printf("4. search ") ;
          
    gotoxy(2512) ;
          
    printf("5. save the file  ") ;
          
    gotoxy(2514) ;
          
    printf("6. load the file  ") ;
          
    gotoxy(2516) ;
          
    printf("7. quit ") ;
          do {
       
    gotoxy(2018) ;
       
    printf("enter your select--www.gach18.blogfa.ir(1-7):");
       
    gets(s);
          } while (
    atoi(s) < || atoi(s) > 7) ;
          return 
    atoi(s) ;
    }
    //*********************
    void enter ()
    {
       
    struct address *info ;
       
    int i ;
       
    char ch ;
       
    clrscr() ;
       
    gotoxy(32) ;
       
    printf("   name        street     city     state    zip");
       
    gotoxy(33) ;
       
    printf(" ------------ -------- ");
       
    printf("--------   -----  ------- ");
       
    ;
       for (;;) {
         
    info = (struct address *)malloc(sizeof(list_entry)) ;
         if(!
    info) {
     
    printf("\n out of memory. press a key ") ;
     
    getch();
     return ;
         }
         
    gotoxy(3i) ;
         
    gets(info -> name) ;
         if (!
    info -> name[0]) {
       
    gotoxy(151) ;
       
    printf("press a key to continue");
       
    getch() ;
       break ;
         }
    //end of if
         
    gotoxy(18i);
         
    gets(info -> street) ;
         
    gotoxy(28i) ;
         
    gets(info -> city) ;
         
    gotoxy(38i) ;
         
    gets(info -> state) ;
         
    gotoxy(45i) ;
         
    gets(info -> zip) ;
         
    i++ ;
         
    start store(infostart) ;
         } 
    /* entry loop */
     
    }
    //**************
    struct address *store(struct address *istruct address *top)
    {
       
    struct address *old, *;
       if(
    last == NULL) {
     
    -> next NULL ;
     
    -> prior NULL ;
     
    start i;
     
    last ;
     return 
    ;
       }
       
    top ;
       
    old NULL ;
       while (
    != NULL) {
           if(
    strcmp(-> name-> name) < 0) {
           
    old ;
           
    -> next ;
           }
    //end of if
           
    else {
          if (
    -> prior) {
        
    -> prior -> next=;
        
    -> next=;
        
    -> prior=-> prior;
        
    -> prior=;
        return 
    top ;
          }
    //end of if
          
    -> next ;
          
    -> prior NULL ;
          
    -> prior ;
          return 
    ;
           }
    //end of if
       
    // end of while
       
    old -> next ;
       
    -> next NULL ;
       
    -> prior old ;
       
    last ;
       return 
    start ;
    }
    //******************
    void del()
    {
       
    struct address *info;
       
    char name[80];
       
    gotoxy(2020) ;
       
    printf(" enter name for delete : ") ;
       
    gets(name) ;
       
    info find(name) ;
       if(
    info == NULL) {
           
    gotoxy(1020) ;
           
    printf(" name not found! press a key to continue.");
           
    getch() ;
       }
       if (
    info)
         if (
    start == info)
     {
       
    start info -> next ;
       if(
    start)
          
    start -> prior NULL ;
       else
          
    last NULL ;
     } 
    //end of if
         
    else  {
        
    info -> prior -> next info -> next;
        if(
    info != last)
       
    info -> next -> prior info -> prior;
        else
      
    last info -> prior ;
         } 
    //end of else
         
    free(info) ;
         
    gotoxy(10,20) ;
         
    printf("name deleted, press a key to continue.");
         
    getch() ;
    }
    //*******************************
    struct address *find(char *name)
    {
         
    struct address *info ;
         
    info start ;
         while(
    info != NULL) {
     if (
    strcmp(nameinfo -> name) == 0)
        return 
    info;
     
    info info -> next ;
         }
         return 
    NULL ;
    }
    //*****************
    void list ()
    {
        
    struct address *info ;
        
    int i ;
        
    info start ;
        
    clrscr() ;
        
    gotoxy(32) ;
        
    printf("   name        street     city     state    zip");
        
    gotoxy(33) ;
        
    printf(" ------------ --------  -");
        
    printf("-------   -----  ------- ");
        
    ;
        while(
    info != NULL) {
     
    display(info, &i) ;
     
    info info -> next ;
        }
        
    gotoxy(152) ;
        
    printf("press a key to continue.");
        
    getch() ;
    }
    //*******************
    void display(struct address *infoint *row)
    {
       
    gotoxy(3, *row) ;
       
    printf("%s"info -> name) ;
       
    gotoxy(18, *row) ;
       
    printf("%s"info -> street) ;
       
    gotoxy(28, *row) ;
       
    printf("%s"info -> city) ;
       
    gotoxy(38, *row) ;
       
    printf(info -> state) ;
       
    gotoxy(47, *row) ;
       
    printf(info -> zip) ;
       *
    row = *row ;
    }
    //**************************
    void search()
    {
         
    char name[40] ;
         
    int i ;
         
    struct address *info;
         
    gotoxy(2020) ;
         
    printf(" enter name to find : ");
         
    gets(name) ;
         
    info find(name) ;
         if(
    info == NULL) {
       
    gotoxy(1020) ;
       
    printf(" name not found! press a key to continue.");
       
    getch() ;
         }
    //end of if
         
    else  {
       
    clrscr() ;
       
    gotoxy(32) ;
       
    printf("   name        street   city     state   zip");
       
    gotoxy(33) ;
       
    printf(" ------------ -------");
       
    printf("-  --------   -----  ------- ") ;
       
    ;
       
    display(info ,&i) ;
       
    gotoxy(152) ;
       
    printf("press a key to continue.");
       
    getch() ;
         }
    //end of else
    }
    //*********************
    void save()
    {
        
    struct address *info ;
        
    FILE *fp ;
        if((
    fp fopen("l.dat","wb")) == NULL)  {
     
    printf("\n cannot open file. ") ;
     
    getch();
     exit(
    1) ;
        }
    //end of if
        
    gotoxy(2020) ;
        
    printf("<< saving file >>") ;
        
    info start ;
        while(
    info) {
          
    fwrite(infosizeof(struct address), 1fp);
          
    info info -> next ;
        }
    //end of while
        
    fclose(fp) ;
        
    gotoxy(1522) ;
        
    printf("file successfuly saved press a key...") ;
        
    getch() ;
    }
    //********************
    void load ()
    {
        
    struct address *info , *temp NULL;
        
    FILE *fp ;
        
    fp fopen("l.dat","rb") ;
        if(
    fp == NULL)  {
     
    printf("\n cannot open file.");
     
    getch();
     exit(
    1) ;
        }
        while(
    start) {
          
    info start -> next ;
          
    free(info) ;
          
    start info ;
        }
        
    gotoxy(20,20) ;
        
    printf(" << loading file  >> ") ;
        
    start NULL ;
        while (!
    feof(fp)) {
       
    info = (struct address *)
      
    malloc(sizeof(struct address)) ;
       if(
    != fread(infosizeof(struct address), 1fp))
         break ;
       if(
    start == NULL)  {
           
    temp start info ;
           
    info -> prior NULL ;
           
    info -> next NULL ;
       }
    //end of if
       
    else  {
           
    info -> next NULL ;
           
    temp -> next info ;
           
    info -> prior temp ;
           
    temp info;
       }
        }
    //end of while
        
    last temp ;
        
    fclose(fp) ;
        
    gotoxy(15,22) ;
        
    printf("file successfuly loaded press a key ...") ;
        
    getch(); 
    }
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  6. 3 کاربر از پست مفید آبجی سپاس کرده اند .


  7. #14
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    رسم خط

    کد PHP:
    #include <graphics.h>
    #include<dos.h>
    #include<iostream.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <conio.h>
    #include<math.h>
    int main(void)
    {
     
    clrscr();
     
    int m,n,x,y,xa,xb,ya,yb,color,dx,dy;
      
    cout<<"Enter (xa,ya) And (xb,yb):\n";
      
    cin>>xa>>ya>>xb>>yb>>color;
      
    xa=abs(xa);
      
    ya=abs(ya);
      
    xb=abs(xb);
      
    yb=abs(yb);
      if(
    xa<xb)
       {
        
    x=xa;
        
    y=ya;
       }
      else
       {
        
    x=xb;
        
    y=yb;
       }
      
    m=(yb-ya)/(xb-xa);
      if(
    m<1)
       {
        
    dx=1;
        
    dy=m;
        
    n=abs(xb-xa);
       }
       else
       {
        
    dy=1;
        
    dx=1/m;
        
    n=abs(yb-ya);
       }
      
    int gdriver DETECTgmodeerrorcode;
      
    initgraph(&gdriver, &gmode"");
      
    errorcode graphresult();
      if (
    errorcode != grOk)
       {
          
    printf("Graphics error: %s\n"grapherrormsg(errorcode));
          
    printf("Press any key to halt:");
          
    getch();
          exit(
    1);
       }
     for(
    int i=0;i<n;i++)
      {
       
    putpixel(int(x),int(y),color);
       
    x+=dx;
       
    y+=dy;
      }
     
    getch();
     
    closegraph();
     return 
    0
    ویرایش توسط آبجی : 26th March 2010 در ساعت 04:14 PM
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  8. 3 کاربر از پست مفید آبجی سپاس کرده اند .


  9. #15
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    دفتر تلفن ساده با کلاس ها

    کد PHP:
    #include <iostream.h>
    #include <conio.h>
    #include <stdlib.h>
    #include <stdio.h>
    #include <ctype.h>
    #include <string.h>

    //=====================================
    //=====================================
    struct address {
           
    char name[30] ;
           
    char street[30] ;
           
    char city[20] ;
           
    char state[3] ;
           
    char number[14] ;
           
    struct address *next ;
           
    struct address *prior ;
    list_entry ;
    //=====================================
    //=====================================
    struct address *start ;
    struct address *last ;

    void enter() , display() , search() ;
    void list() , del();
    void display(struct address *infoint *row);

    struct address *find(char *);
    int menu_select();
    struct address *store(struct address *, struct address *);
    //=====================================
    //=====================================




    //****************

    int menu_select()
    {
          
    char s[5];
          
    system("cls");
          
    gotoxy(25,4) ;
          
    printf("1. enter a name ") ;
          
    gotoxy(25,6) ;
          
    printf("2. delete a name ") ;
          
    gotoxy(258) ;
          
    printf("3. list all files ") ;
          
    gotoxy(2510) ;
          
    printf("4. search ") ;
          
    gotoxy(2512) ;
          
    printf("5. quit ") ;
          do {
          
    gotoxy(2018) ;
          
    printf("enter your select--power By majid (1-5):");
          
    gets(s);
          } while (
    atoi(s) < || atoi(s) > 5) ;
          return 
    atoi(s) ;
    }
    //*********************


    void enter ()
    {
       
    struct address *info ;
       
    int i ;
       
    char ch ;
       
    system("cls") ;
       
    gotoxy(32) ;
       
    printf("   name        street     city     state    number");
       
    gotoxy(33) ;
       
    printf(" ------------ -------- ");
       
    printf("--------   -----  ------- ");
       
    ;
       for (;;) {
         
    info = (struct address *)malloc(sizeof(list_entry)) ;
         if(!
    info) {
        
    printf("\n out of memory. press a key ") ;
        
    getch();
        return ;
         }
         
    gotoxy(3i) ;
         
    gets(info -> name) ;
         if (!
    info -> name[0]) {
          
    gotoxy(151) ;
          
    printf("press a key to continue");
          
    getch() ;
          break ;
         }
    //end of if
         
    gotoxy(18i);
         
    gets(info -> street) ;
         
    gotoxy(28i) ;
         
    gets(info -> city) ;
         
    gotoxy(38i) ;
         
    gets(info -> state) ;
         
    gotoxy(45i) ;
         
    gets(info -> number) ;
         
    i++ ;
         
    start store(infostart) ;
         } 
    /* entry loop */
        
    }
    //**************


    struct address *store(struct address *istruct address *top)
    {
       
    struct address *old, *;
       if(
    last == NULL) {
        
    -> next NULL ;
        
    -> prior NULL ;
        
    start i;
        
    last ;
        return 
    ;
       }
       
    top ;
       
    old NULL ;
       while (
    != NULL) {
           if(
    strcmp(-> name-> name) < 0) {
              
    old ;
              
    -> next ;
           }
    //end of if
           
    else {
             if (
    -> prior) {
              
    -> prior -> next=;
              
    -> next=;
              
    -> prior=-> prior;
              
    -> prior=;
              return 
    top ;
             }
    //end of if
             
    -> next ;
             
    -> prior NULL ;
             
    -> prior ;
             return 
    ;
           }
    //end of if
       
    // end of while
       
    old -> next ;
       
    -> next NULL ;
       
    -> prior old ;
       
    last ;
       return 
    start ;
    }
    //******************


    void del()
    {
       
    struct address *info;
       
    char name[80];
       
    gotoxy(2020) ;
       
    printf(" enter name for delete : ") ;
       
    gets(name) ;
       
    info find(name) ;
       if(
    info == NULL) {
           
    gotoxy(1020) ;
           
    printf(" name not found! press a key to continue.");
           
    getch() ;
       }
       if (
    info)
         if (
    start == info)
        {
          
    start info -> next ;
          if(
    start)
             
    start -> prior NULL ;
          else
             
    last NULL ;
        } 
    //end of if
         
    else  {
           
    info -> prior -> next info -> next;
           if(
    info != last)
             
    info -> next -> prior info -> prior;
           else
            
    last info -> prior ;
         } 
    //end of else
         
    free(info) ;
         
    gotoxy(10,20) ;
         
    printf("name deleted, press a key to continue.");
         
    getch() ;
    }
    //*******************************


    struct address *find(char *name)
    {
         
    struct address *info ;
         
    info start ;
         while(
    info != NULL) {
        if (
    strcmp(nameinfo -> name) == 0)
           return 
    info;
        
    info info -> next ;
         }
         return 
    NULL ;
    }
    //*****************


    void list ()
    {
        
    struct address *info ;
        
    int i ;
        
    info start ;
        
    system("cls") ;
        
    gotoxy(32) ;
        
    printf("   name        street     city     state    number");
        
    gotoxy(33) ;
        
    printf(" ------------ --------  -");
        
    printf("-------   -----  ------- ");
        
    ;
        while(
    info != NULL) {
        
    display(info, &i) ;
        
    info info -> next ;
        }
        
    gotoxy(152) ;
        
    printf("press a key to continue.");
        
    getch() ;
    }
    //*******************


    void display(struct address *infoint *row)
    {
          
    gotoxy(3, *row) ;
          
    printf("%s"info -> name) ;
          
    gotoxy(18, *row) ;
          
    printf("%s"info -> street) ;
          
    gotoxy(28, *row) ;
          
    printf("%s"info -> city) ;
          
    gotoxy(38, *row) ;
          
    printf(info -> state) ;
          
    gotoxy(47, *row) ;
          
    printf(info -> number) ;
          *
    row = *row ;
    }
    //**************************


    void search()
    {
         
    char name[40] ;
         
    int i ;
         
    struct address *info;
         
    gotoxy(2020) ;
         
    printf(" enter name to find : ");
         
    gets(name) ;
         
    info find(name) ;
         if(
    info == NULL) {
          
    gotoxy(1020) ;
          
    printf(" name not found! press a key to continue.");
          
    getch() ;
         }
    //end of if
         
    else  {
              
    system("cls") ;
              
    gotoxy(32) ;
              
    printf("   name        street   city     state   number");
              
    gotoxy(33) ;
              
    printf(" ------------ -------");
              
    printf("-  --------   -----  ------- ") ;
              
    ;
              
    display(info ,&i) ;
              
    gotoxy(152) ;
              
    printf("press a key to continue.");
              
    getch() ;
         }
    //end of else
    }
    //*********************

    int main()
    {
           
    start last NULL ;
           for(;;) {
             switch(
    menu_select()) {
               case 
    1:  enter();  break ;
               case 
    del();    break ;
                case 
    3:  list() ;  break ;
               case 
    4:  search(); break ;
               case 
    5:  exit(0) ;

            }
    //end of switch
           
    }//end of for
    }//end of main 
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  10. 2 کاربر از پست مفید آبجی سپاس کرده اند .


  11. #16
    دوست آشنا
    رشته تحصیلی
    کامپیوتر
    نوشته ها
    1,151
    ارسال تشکر
    3,303
    دریافت تشکر: 2,587
    قدرت امتیاز دهی
    37
    Array
    بانوثریا's: جدید117

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    آبجی به نظرت بچه ها با این کارشون تنبل نمیشن؟؟؟
    عقاب همیشه تنهاست...اما لاشخورها همیشه با هم اند
    فعالیتم رو در این سایت متوقف کردم... موفق باشید

  12. 2 کاربر از پست مفید بانوثریا سپاس کرده اند .


  13. #17
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    کتابخانه با امکان ورود - ویرایش- حذف -به امانت گرفتن و پس دادن کتاب

    کد PHP:
    #include<iostream.h>
    #include<conio.h>
    #include<stdio.h>
    #include<string.h>

    //===========================
    //===========================
    class book
    {
     
    friend class library;

     private:
        
    char book_name[11];
        
    char explain[51];
        
    char aouther[11];
        
    char part;

        
    char user[11];    
         
    int reserved;

        
    book *next;

     public:
             
    book();
        
    void edit();
        
    void reserv();
        
    void getback();
    }
    //---------------------------
         
    book::book()
        {
         
    clrscr();

         
    cout<<"============ add a new book =================="
             
    <<"\n\nto insert new book ,enter flow informations:"
             
    <<"\n\nbook name?";
         
    gets(book_name);
         
    book_name[10]=NULL;

         
    cout<<"\naouther name?";
         
    gets(aouther);
         
    aouther[10]=NULL;

         
    cout<<"\nany explain?";
         
    gets(explain);
         
    explain[50]=NULL;

         
    part=book_name[0];

         
    reserved=0;

         
    next=NULL;

         
    cout<<"\n\ninformathions set!";
         
    getch();
        }
    //---------------------------
    void book::edit()
        {
    cout<<"error ";
        }
    //---------------------------
    void book::reserv()
        {
         
    clrscr();
         
    cout<<"\n=========== reserving book ===================";

         if(
    reserved==0)
            {
             
    cout<<"\n\nuser name?";
             
    gets(user);
             
    user[11]=NULL;

             
    reserved=1;
            }

         if(
    reserved==0)
            {
             
    cout<<"\n\nsorry! book has been reserved befor"
                 
    <<"by user:";
             
    puts(user);
            }

         
    getch();
        }
    //---------------------------
    void book::getback()
        {
         
    reserved=0;

         
    cout<<"\n\nbook got bak.";
         
    getch();
        }
    //===========================
    //===========================
    class library
    {
     public:
              
    library();
         
    void run_menu();

     private:
         
    book *parts[24];
         
    void insert(book*);
         
    void find();
         
    void search();

    }
    //---------------------------
         
    library::library()
        {
         for(
    int i=0;i<=23;i++)
            
    parts[i]=NULL;

        }
    //---------------------------
    void library::run_menu()
        {

         
    char ch='n';

         while(
    ch!='4')
            {
             
    clrscr();

             
    cout<<"================= LIBRARY =================="
                 
    <<"\n\n1:add a new book."
                 
    <<"\n2:find a book."
                 
    <<"\n3:search a book."
                 
    <<"\n4:exit."
                 
    <<"press numbers:";


             
    ch=getch();


             if(
    ch=='1')
                {
                 
    book *n=new book;
                 
    insert(n);
                }
             if(
    ch=='2')
                {
                 
    find();
                }
             if(
    ch=='3')
                {
                 
    search();
                }

            }
    //while
        
    }
    //---------------------------
    void library::insert(book *s)
        {
         
    int d=s->part-97;

         if(
    parts[d]==NULL)
            {
             
    parts[d]=s;
            }
         else
            {
             
    book *p=parts[d],*q;
             while(
    p!=NULL && strcmp(p->book_name,s->book_name)<0)
                {
                 
    q=p;
                 
    p=p->next;
                }
             
    q->next=s;
             
    s->next=p;
            }

        }
    //---------------------------
    void library::find()
        {
         
    clrscr();

         
    cout<<"=========== edit / delete books ============"
             
    <<"\nenter exact book name:";
         
    char name[11];
         
    gets(name);
         
    name[11]=NULL;
         
    int d=name[0]-97;

         
    book *p=parts[d],*q;
         while(
    p!=NULL && strcmp(p->book_name,name)!=0)
            {
             
    q=p;
             
    p=p->next;
            }
         if(
    p==NULL)
            {
             
    cout<<"not found!";
            }
         if(
    p!=NULL)
            {
             
    cout<<"\n\ndelete it?('d')  or edit?('e')"
                 
    <<"  or reserv?('r')   or getback?('g') :";
             
    char ch=getch();
             if(
    ch=='d')
                 {
                  
    q->next=p->next;
                  
    delete p;
                 }
             if(
    ch=='e')
                 {
                  
    p->edit();
                 }
             if(
    ch=='r')
                 {
                  
    p->reserv();
                 }
             if(
    ch=='g')
                {
                 
    p->getback();
                }
            }
         
    getch();
        }
    //---------------------------
    void library::search()
        {
         
    char ch='6';

         while(
    ch!='4')
            {
             
    clrscr();
             
    cout<<"================== SEARCH ===================";
             
    cout<<"\n\n1:search for name."
                 
    <<"\n2:search for aouther."
                 
    <<"\n3:search for explanations."
                 
    <<"\n4:back to main menu.(press numbers)";

             
    ch=getch();

             if(
    ch=='1')
                {
                 
    cout<<"\n\nenter exact name:";
                 
    char name[10];
                 
    gets(name);
                 
    name[11]=NULL;

                 
    int d=name[0]-97;
                 
    book *p=parts[d];
                 while(
    p!=NULL && strcmp(p->book_name,name)!=0)
                    {
                     
    p=p->next;
                    }
                 if(
    p==NULL)
                    {
                     
    cout<<"\nnot founded!";
                    }
                 else
                    {
                     
    cout<<"\n\n";
                     
    cout<<"name:";puts(p->book_name);
                     
    cout<<"aouther:";puts(p->aouther);
                     
    cout<<"explain:";puts(p->explain);
                     if(
    p->reserved==1)
                        {
                         
    cout<<"RESERVED by:";
                         
    puts(p->user);
                        }
                     else
                        {
                         
    cout<<"NOT RESERVES";
                        }
                    }
    //else
                 
    getch();
                }
    //1
             
    if(ch=='2')
                {
                 
    cout<<"\n\nenter exact aouther name:";
                 
    char name[11];
                 
    gets(name);
                 
    name[11]=NULL;
                 
    int f=0;

                 for(
    int i=0;i<=23;i++)
                   {
                    
    book *p=parts[i];
                    while(
    p!=NULL)
                    {
                     if(
    strcmp(p->aouther,name)==0)
                        {
                         
    f++;
                         
    cout<<"\n"<<f<<":";
                         
    cout<<"name:";puts(p->book_name);
                         
    cout<<"aouthor:";puts(p->aouther);
                         
    cout<<"explain:";puts(p->explain);
                         if(
    p->reserved==1)
                            {
                             
    cout<<"RESERVED BY";
                             
    puts(p->user);
                            }
                         else
                            {
                             
    cout<<"NOT RESERVED";
                            }
                        }

                     
    p=p->next;
                    }
    //while
                   
    }
                 
    getch();
                }
    //2
             
    if(ch=='3')
                {
                 
    cout<<"\n\nenter key(15char):";
                 
    char name[16];
                 
    gets(name);
                 
    name[15]=NULL;
                 
    int f=0;

                 for(
    int i=0;i<=23;i++)
                   {
                    
    book *p=parts[i];
                    while(
    p!=NULL)
                    {
                     
    char *tokenptr;
                     
    tokenptr=strtok(p->explain," ");
                     while(
    tokenptr!=NULL)
                        {
                         if(
    strcmp(tokenptr,name)==0)
                            {
                             
    f++;

                             
    cout<<"\n"<<f<<":";
                             
    cout<<"name:";puts(p->book_name);
                             
    cout<<"aouthor:";puts(p->aouther);
                             
    cout<<"explain:";puts(p->explain);
                             if(
    p->reserved==1)
                                 {
                                  
    cout<<"RESERVED BY";
                                  
    puts(p->user);
                                 }
                             else
                                 {
                                  
    cout<<"NOT RESERVED";
                                 }
                            }
                         
    tokenptr=strtok(NULL," ");
                        }

                     
    p=p->next;
                    }
    //while
                   
    }//for i
                 
    getch();
                }
    //3

            
    }

        }
    //===========================
    //===========================
     
    int main()
        {
         
    clrscr();

         
    library l1;
         
    l1.run_menu();

         return(
    0);
        } 
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  14. 4 کاربر از پست مفید آبجی سپاس کرده اند .


  15. #18
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    Ok پاسخ : پروژه هاي برنامه نويسي

    تغییر رنگ نوشته متن :

    کامپایلر : Borland C++‎ 5.02
    روش اول :



    کد PHP:
    #include <iostream>
    #include <conio>
    int main(){
    for(
    int i=1;i<=4;i++){
    textcolor(i+8);
    cprintf("Welcome to C++‎ World");
    cout<<endl;}
    getch();

    روش دوم :



    کد PHP:
    #include <iostream>
    #include <conio>
    #include <stdlib>
    int main(){
    for(
    int i=1;i<=4;i++){
    system("color 0A");
    cout<<"Welcome to C++‎ World\n";
    }
    getch();

    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  16. 3 کاربر از پست مفید آبجی سپاس کرده اند .


  17. #19
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    خب این هم برنامه ای که با روش بازگشتی عددی از مبنای 10 رو به هر مبنای تبدیل میکنه :



    کد PHP:
    #include <iostream>
    #include <conio>
    void Base(int n,int x){
     if(
    n<x)
       
    cout<<n;
       else{
        
    Base(n/x,x);
         
    cout<<n%x;
         }
    }
    //=====================
    int main(){
    int x,n;
    cout<<"Enter a number in decimal :\n";
    cin>>n;
    cout<<"Enter base :\n";
    cin>>x;
    cout<<"------------------------\n";
    Base(n,x);
    getch(); 
    }
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  18. 3 کاربر از پست مفید آبجی سپاس کرده اند .


  19. #20
    کـــــــاربر فــــعال
    رشته تحصیلی
    کامپیوتر(مهندسی نرم افزار)
    نوشته ها
    18,304
    ارسال تشکر
    4,182
    دریافت تشکر: 19,008
    قدرت امتیاز دهی
    220
    Array

    پیش فرض پاسخ : پروژه هاي برنامه نويسي

    این همبرنامه ای برای پیدا کردن فاکتوریل یک عدد بروش برنامه نویسی پویا

    کد PHP:
    #include <iostream>
    #include <conio>
    int main(){
    int n;
    cout<<"Enter a number :\n";
    cin>>n;
    int *= new int[n+1];
    a[0] = 1;
    for(
    int i=1;i<=n;i++)
     
    a[i] = i*a[i-1];
     for(
    int i=0;i<=n;i++)
      
    cout<<i<<"! = "<<a[i]<<endl;
      
    getch();
      } 
    شنبه : یارب العالمین 1شنبه : یا ذاالجلال والاکرام
    2شنبه : یا قاضی الحاجات 3شنبه : یاارحم الراحمین
    4شنبه : یا حی یاقیوم 5شنبه : لا اله الا الله الملک الحق المبین
    جمعه : اللهم صل علی محمد وال محمد وعجل فرجهم

  20. 3 کاربر از پست مفید آبجی سپاس کرده اند .


صفحه 2 از 19 نخستنخست 123456789101112 ... آخرینآخرین

اطلاعات موضوع

کاربرانی که در حال مشاهده این موضوع هستند

در حال حاضر 1 کاربر در حال مشاهده این موضوع است. (0 کاربران و 1 مهمان ها)

موضوعات مشابه

  1. مقاله: نقش منشور پروژه در كاميابي پروژه
    توسط MR_Jentelman در انجمن مجموعه مدیریت اجرایی
    پاسخ ها: 0
    آخرين نوشته: 22nd January 2010, 09:24 AM
  2. دانلود: برترين برنامه هاي رايگان 1388
    توسط Victor007 در انجمن سایر نرم افزارها
    پاسخ ها: 0
    آخرين نوشته: 12th December 2009, 12:42 PM
  3. مقاله: تفاوتهاي برنامه ريزي استراتژيک در سازمانها
    توسط MR_Jentelman در انجمن مجموعه مدیریت اجرایی
    پاسخ ها: 0
    آخرين نوشته: 27th July 2009, 10:14 AM
  4. سنجش موفقيت برنامه ريزي فناوري اطلاعات
    توسط engeneer_19 در انجمن مباحث فناوری اطلاعات
    پاسخ ها: 0
    آخرين نوشته: 26th July 2009, 08:33 PM

کلمات کلیدی این موضوع

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •