jara

11ove11beFri, 28 Nov 2008 03:35:03 +0000 28,2008

Filed under: Program 1 - Administrator @ 3:35 am

#include<stdio.h>

#include<conio.h>

#include <stdlib.h>

 

 

main(){

       float sales[20];

       float salary[20];

       int x;

       float per = .09;

       for(x=0 ;x<=20;x++){

            printf("Enter Sales in dollar(-1 to end): ");

            scanf("%f",&sales[x]);

            // for -1 input

            if(sales[x]== -1){

                             break;

            }

       salary[x] = sales[x] * per + 200;

       printf("Salary is: $%.2f\n\n\n\n",salary[x]);

       if(x >= 19 ){

                                    printf("Array Exceeded Exiting Program. . .");

                                    getch();

            }

       }

}

 

 

 

 

 

Filed under: Program 1 - Administrator @ 3:33 am

#include<stdio.h>

#include<conio.h>

#include <stdlib.h>

int main(){

    int accountN[5];

    float balance[5];

    float charges[5];

    float credits[5];

    float creditL[5];

    float nBalance[5];

    int x;

    for(x=0 ;x<5;x++){

            printf("Enter Account Number(-1 to end): ");

            scanf("%d",&accountN[x]);

            // for -1 input

            if(accountN[x]== -1){

                             getch();

                             break;

            }

            printf("Enter Beginning Balance: ");

            scanf("%f",&balance[x]);

            printf("Enter Total Charges: ");

            scanf("%f",&charges[x]);

            printf("Enter Total Credits: ");

            scanf("%f",&credits[x]);

            printf("Enter Credit Limit: ");

            scanf("%f",&creditL[x]);

            nBalance[x] = balance[x] + charges[x] - credits[x];

            printf("\n");

            if(nBalance[x] > creditL[x]){

                           printf("\n");

                           printf("\n");

                        printf("\nAccount:\t %d", accountN[x]);

                        printf("\nCredit Limit:\t %.2f ",creditL[x] );

                        printf("\nBalance:\t %.2f", nBalance[x]);

                        printf("\nCredit Limit Exceeded.\n");

                        printf("\n");

                        printf("\n");

            }

    }

}

assignment

Filed under: Uncategorized - Administrator @ 3:27 am

#include<stdio.h>

#include<conio.h>

#include <stdlib.h>

int main(){

           float gallons[5];

           int x;

           int miles[5];

           int totalM = 0;

           float total = 0;

           float totalN=0;

           float ave;

           for(x=0 ;x<5;x++){

           printf("\nEnter Gallons used(-1 to end): ");

           scanf("%f",&gallons[x]);

           if(gallons[x] == -1){

                   break;//exit

           }

           printf("Enter Miles Driven: ");

           scanf("%d",&miles[x]);

           // summation

           totalM += miles[x];

           totalN += gallons[x];

           total = miles[x] / gallons[x];

           ave = totalM / totalN;

           printf("\nThe Miles / gallon for this tank was %.6f\n",total);

           }// end of loop

           printf("\nThe Overall average miles/gallon was %.6f",ave);

           getch();

}

 

prelim exam

Filed under: Uncategorized - Administrator @ 3:24 am

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main(){
       char subject[]= "Cprog1:";
       char subject1[]= "CHST:";
       char subject2[]= "English2:";
       char subject3[]= "Math2:";
       char subject4[]= "Filipino2:";
       int id;
       float total[4];
       float pGrade[4];
       float mGrade[4];
       float fGrade[4];
       float ave[4];
       float sAve;
       float pAve,mAve,fAve;
    printf("CPROG 1 \nPRELIM PRACTICAL EXAM \nAY2007 - 2008\n\n");
    printf("\nEnter Your 3 digits ID number: ");
    scanf("%d",&id);
    printf("\nEnter Subjects taken / enrolled and their prelim , midterm and finals Grades.\n");
    printf("—————————————————————————–\n");
    printf("Subjects\t\tPrelim\t\tMidterm\t\tFinals\n");
    printf("—————————————————————————–\n");
    
    for(int x = 0;x<5;x++){
    if(x==0){
    printf("%s",subject);
    }
    if(x==1){
    printf("%s",subject1);
    }
    if(x==2){
    printf("%s",subject2);
    }
    if(x==3){
    printf("%s",subject3);
    }
    if(x==4){
    printf("%s",subject4);
    }
            scanf("%f",&pGrade[x]);
            scanf("%f",&mGrade[x]);
            scanf("%f",&fGrade[x]);
            total[x] = pGrade[x] + mGrade[x] + fGrade[x];
            ave[x] = total[x]/3;
            pAve += pGrade[x];
            mAve += mGrade[x];
            fAve += fGrade[x];
    }
    printf("\n");
    for(int x = 0;x<5;x++){
    if(x==0){
    printf("%s Average:",subject);
    }
    if(x==1){
    printf("%s Average:",subject1);
    }
    if(x==2){
    printf("%s Average:",subject2);
    }
    if(x==3){
    printf("%s Average:",subject3);
    }
    if(x==4){
    printf("%s Average:",subject4);
    }
    printf("%.2f \n",ave[x]);
    }
    float gP,gM,gF;
    gP = pAve/5;
    gM = mAve/5;
    gF = fAve/5;
    printf("\n\n\n\tPrelim Average: %.2f ",gP);
    printf("\n\tMidterm Average: %.2f ",gM);
    printf("\n\tFinal Average: %.2f ",gF);
    sAve = (gP + gM+ gF)/3;
    printf("\n\tSemester Average: %.2f\n ",sAve);
    
    printf("\n—————————————————————————–\nSUMMARY:\n");
    printf("Your Semester Average is %.2f and your ID number is %d.\n ",sAve,id);
    printf("\n—————————————————————————–\nFinal Decision:\n");
    if(sAve < 75 )
            printf("Failed, not qualified for the course!\n");
    else
            printf("You can now proceed to the next level!\n");
    if(sAve >= 75 && sAve <80)
    printf(" %.2fPassed, probationary status!" , sAve);
    if(sAve >= 80 && sAve <85)
    printf(" %.2fPassed, regular student!", sAve);
    if(sAve >= 85 && sAve < 90)
    printf(" %.2fThird Honor, Congratulations!", sAve);
    if(sAve == 90 && sAve <95)
    printf(" %.2fSecond Honor, Congratulations!", sAve);
    if(sAve == 95 && sAve <100)
    printf(" %.2fFirst Honor, Congratulations!", sAve);
    if(sAve==100)
    printf(" %.2fPerfect, Excellent!");
    printf("\n—————————————————————————–");
    printf("\n-End Of Program-");

    
    getch();
}

3ove03beWed, 12 Mar 2008 13:51:08 +0000 28,2008

Hello world!

Filed under: Uncategorized - Administrator @ 1:51 pm

Welcome to your new blog. This is your first post. Edit or delete it, then start blogging!

An email has been sent to you giving you details of how to log in to the administration section. From there you can change the design by clicking on the tab MANAGE and then click on the tab THEMES. If you have any questions, ask them in the forums — we are only too willing to help.

Get free blog up and running in minutes with Blogsome
Theme designed by Janis Joseph