folder Tahribat.com Forumları
linefolder Genel
linefolder Cok Acilll C++ Yardımm



Cok Acilll C++ Yardımm

  1. KısayolKısayol reportŞikayet pmÖzel Mesaj
    ozhamann
    ozhamann's avatar
    Kayıt Tarihi: 08/Mart/2007
    Erkek

    #include<stdio.h>
    struct data{
    char month[3];
    float Kay;
    float Kon;
    float Tok;
    float max_m;
    };
    enum aylar {
    JAN=0, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, DEC };
    enum sehirler {
    KAY=0, KON, TOK};

    int main()
    {
    int year,func1,func2;
    float max_month=0, tot_Kay=0,tot_Kon=0,tot_Tok=0,tot_tot=0;
    enum aylar months_en;
    enum sehirler locs;
    struct data d5[12]={{"Jan",51.4,56.6,55.8},{"Feb",51.8,52.1,53.4},{"Mar",61.3,57.0,52.9},{"Apr",56.5,50.9,54.8},{"May",55.8,52.6,51.3},{"Jun",56.7,58.5,58.9},{"Jul",50.1,57.2,54.2},{"Aug",51.7,53.1,53.4},{"Sep",54.7,58.6,50.4},{"Oct",54.1,57.4,55.0},{"Nov",59.0,54.0,58.9},{"Dec",57.0,59.6,56.5}};

    struct data d6[12]={{"Jan",54.8,57.5,59.4},{"Feb",53.0,54.1,58.3},{"Mar",64.9,55.8,54.5},{"Apr",61.3,53.4,59.6},{"May",57.9,53.2,51.8},{"Jun",58.3,60.5,62.2},{"Jul",52.6,57.0,56.8},{"Aug",54.0,56.1,54.8},{"Sep",56.6,61.8,53.2},{"Oct",54.2,57.8,58.5},{"Nov",60.6,58.2,61.6},{"Dec",61.8,62.5,57.2}};


    printf("Please type \n(1) for the year 2005...\n(2) for the year 2006...\n(0) to quit..");
    scanf("%d",&year);

    if(year == 1)
    {
        system("clear");
        printf("(1) for alphabetical order of provinces...\n(2) for provinces ordered in decreasing order of totals that year...\n(0) to quit...");
        scanf("%d", &func1);
        while(func1 == 1 || func1 ==2){
            switch(func1){
            
            case 1:
            system("clear");
            printf("\n\n\n%10s%9s%8s%10s%15s\n","Year 2005","Kayseri","Konya", "Tokat","Monthly Total");
            for(ay=JAN; ay<=DEC; ay++)
                {
                    d5[months_en].max_m = d5[months_en].Kay+d5[months_en].Kon+d5[months_en].Tok;
                    if(d5[months_en].max_m > max_month)
                        {
                            max_month=d5[months_en].max_m;
                        }    
                    tot_Kay+=d5[months_en].Kay;
                    tot_Kon+=d5[months_en].Kon;
                    tot_Tok+=d5[months_en].Tok;
                    tot_tot+=d5[months_en].max_m;
                }
            for(ay=JAN; ay<=DEC; ay++)
                {
                    if(d5[months_en].max_m == max_month)
                        {
                            printf("%7s%10.2f%10.2f%10.2f%10.2f  max \n", d5[months_en].month, d5[months_en].Kay, d5[months_en].Kon, d5[months_en].Tok,d5[months_en].max_m);
                        }
                    else
                        {
                            printf("%7s%10.2f%10.2f%10.2f%10.2f\n", d5[months_en].month, d5[months_en].Kay, d5[months_en].Kon, d5[months_en].Tok, d5[months_en].max_m);
                        }
            
                }
            printf("%10s%8.2f%10.2f%10.2f%10.2f\n","Yearly",tot_Kay, tot_Kon, tot_Tok, tot_tot);
            printf("%25s\n","max");
            printf("\n\n");
            return (main());
            break;

            case 2:
                system("clear");
                printf("\n\n\n%10s%9s%8s%10s%15s\n","Year 2005","Tokat","Kayseri", "Konya","Monthly Total");
                for(ay=JAN; ay<=DEC; ay++)
                    {
                        d5[months_en].max_m = d5[months_en].Kay+d5[months_en].Kon+d5[months_en].Tok;
                        if(d5[months_en].max_m > max_month)
                            {
                            max_month=d5[months_en].max_m;
                            }    
                        tot_Kay+=d5[months_en].Kay;
                        tot_Kon+=d5[months_en].Kon;
                        tot_Tok+=d5[months_en].Tok;
                        tot_tot+=d5[months_en].max_m;
            
                    }
                for(ay=JAN; ay<=DEC; ay++)
                {
                    if(d5[months_en].max_m == max_month)
                    {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f  max \n", d5[months_en].month, d5[months_en].Tok, d5[months_en].Kay, d5[months_en].Kon,d5[months_en].max_m);
                    }
                    else
                    {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f\n", d5[months_en].month, d5[months_en].Tok,     d5[months_en].Kay, d5[months_en].Kon, d5[months_en].max_m);
                    }
                }
            printf("%10s%8.2f%10.2f%10.2f%10.2f\n","Yearly",tot_Tok, tot_Kay, tot_Kon, tot_tot);
            printf("%35s\n","max");
            printf("\n\n");
            return (main());
            break;
        
        }/*1st switch case*/
        }/*end of while*/
        }/*end for if*/
        else if(year == 2) {
            system("clear");
            printf("(1) for alphabetical order of provinces...\n(2) for provinces ordered in decreasing order of totals that year...\n(0) to quit...");
            scanf("%d", &func2);
            while(func2 != 0){
            switch(func2){
            case 1:
                system("clear");
                printf("\n\n\n%10s%9s%8s%10s%15s\n","Year 2006","Kayseri","Konya", "Tokat","Monthly Total");
                for(ay=JAN; ay<=DEC; ay++)
                {
                    d6[months_en].max_m = d6[months_en].Kay+d6[months_en].Kon+d6[months_en].Tok;
                    if(d6[months_en].max_m > max_month)
                    {
                    max_month=d6[months_en].max_m;
                    }    
                tot_Kay+=d6[months_en].Kay;
                tot_Kon+=d6[months_en].Kon;
                tot_Tok+=d6[months_en].Tok;
                tot_tot+=d6[months_en].max_m;        
                }
                for(ay=JAN; ay<=DEC; ay++)
                {
                if(d6[months_en].max_m == max_month)
                    {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f  max \n", d6[months_en].month, d6[months_en].Kay, d6[months_en].Kon, d6[months_en].Tok,d6[months_en].max_m);
                    }
                else
                {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f\n", d6[months_en].month, d6[months_en].Kay, d6[months_en].Kon, d6[months_en].Tok, d6[months_en].max_m);
                }
            
                }
            printf("%10s%8.2f%10.2f%10.2f%10.2f\n","Yearly",tot_Kay, tot_Kon, tot_Tok, tot_tot);
            printf("%15s\n","max");
            printf("\n\n");
            return (main());
            break;

            case 2:
                system("clear");
                printf("\n\n\n%10s%7s%10s%12s%15s\n","Year 2006","Konya","Tokat", "Kayseri","Monthly Total");
                for(ay=JAN; ay<=DEC; ay++)
                {
                d6[months_en].max_m = d6[months_en].Kay+d6[months_en].Kon+d6[months_en].Tok;
                if(d6[months_en].max_m > max_month)
                {
                    max_month=d6[months_en].max_m;
                }    
                tot_Kay+=d6[months_en].Kay;
                tot_Kon+=d6[months_en].Kon;
                tot_Tok+=d6[months_en].Tok;
                tot_tot+=d6[months_en].max_m;
            
                }
                for(ay=JAN; ay<=DEC; ay++)
                {
                    if(d6[months_en].max_m == max_month)
                    {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f  max \n", d6[months_en].month, d6[months_en].Kon, d6[months_en].Tok, d6[months_en].Kay,d6[months_en].max_m);
                    }
                    else
                    {
                    printf("%7s%10.2f%10.2f%10.2f%10.2f\n", d6[months_en].month, d6[months_en].Kon, d6[months_en].Tok, d6[months_en].Kay, d6[months_en].max_m);
                    }
            
                }
            printf("%10s%8.2f%10.2f%10.2f%10.2f\n","Yearly",tot_Kon, tot_Tok, tot_Kay, tot_tot);
            printf("%35s\n","max");        
            printf("\n\n");
            return (main());
            break;

            
        }/*end for switch case func2*/
        }/*end for while switch case func2*/
    }/*end for else if */
    return 0;
    }

     

    biz kodun bu kadarını yazabildikk tam sorusu aşşağıda veriorum yardım edebilicek arkadaşa 250 kntur veya 30ytl verebilirim çok acil olduğu için böle bi pozisyona düştüm yaz okulu projesi ve mutlaka teslim etmem gerekiyo yoksa dersten kalıcam yardımcı olabilicek arkadaş bana programı tamamladıktan sonra paramı istio konturmu onu pmden atarsa hemen geri dönücemm gerçekten yardıma çok ihtiyacım var....

    soru bold italic ve altı çizili olan yer  

    Assignment 2

    CSE200 Summer 2007
    Assignment 2: Sweetening Iraq

    Scenario: Turkey currently exports sugar worldwide including to several countries in the Eastern Mediterranean region with Iraq taking nearly half. Production is expected to increase in 2007.


    To illustrate this successful commerce, sugar production figures in three provinces of Turkey for the months of 2005 and 2006 (contrived data) show a general increase with estimates of increasing yields in 2007.


    Task: Write a program to process these data. For each year print the months in rows and the provinces in columns. At the end of each row is the monthly sum and, in addition, the month with the maximum total production of the three provinces has the word ‘max’ written to the right of the total column. At the end of each column is the province sum over the year with an extra line showing the word ‘max’ under the province with maximum yearly production.


    In addition, the user may then choose continually to display the partial results differently. The user first chooses a year and then chooses printout according to one of two criteria:

    • alphabetical order of provinces, or

    • provinces ordered in decreasing order of totals that year.

    Of course, both these choices are prompted.


    Implementation:

    Use an enumerated type for months and another one for provinces (as explained in Moderato Lab 5).


    Do not change the original array in any way or make a copy, but choose the column for printout using an (extra) sorted array of subscripts (as explained in Moderato Lab 5).

     

    Bonus points for inputting data from an external file (or two).


    Sample data: Available on Course Online in a csv file. This file can be opened in Excel. Also as a text file (open in Notepad) the data can be copied to the C program for creating array initialization by editing (insertion of { and }, removal of context data, and so on)

     

     Sample data ksımı kafa karıştırmasın, programda array olarak girdim ben sample datayı..

     

     

     


    Death is certain life is Not...
  2. KısayolKısayol reportŞikayet pmÖzel Mesaj
    ozhamann
    ozhamann's avatar
    Kayıt Tarihi: 08/Mart/2007
    Erkek
    yokmu yardım  edebilicek 1 kişi?

    Death is certain life is Not...
Toplam Hit: 945 Toplam Mesaj: 2