View Single Post
Old 10-10-2007, 03:49 AM   #1 (permalink)
TheGW
SuperKenshin's Servent
 
TheGW's Avatar
 
Join Date: Apr 2007
Location: Tacloban City, Leyte, Republic Of The Philippines
Posts: 1,068
TheGW is on a distinguished road
Send a message via Yahoo to TheGW
Unhappy [HELP]A New Program Of Mine...

Code:
#include<string.h>
#include<ctype.h>

    main()
    {
        char pass[]="QUIDDITCH",password[20]="\0",ans;
        char name[5][20],temp;

        int count1=0,count2=0,count3=0,times;
        int a=2,b=2,c=2,d=2,e=2;

        float q1[5],q2[5],q3[5];
        float studave[5],ave1=0,ave2=0,ave3=0;
        float sum1=0.0,sum2=0.0,sum3=0.0;

        clrscr();

        do
        {
            gotoxy(15,10);
            printf("ENTER SECURITY CODE:   ");

            do
            {
                password[count2]=getch();
                printf("*");
                count2+=1;

            }    while(password[count2-1]!='\r');
                password[count2-1]='\0';

            clrscr();

            if(strcmp(pass,password)==0)
            {
                gotoxy(25,10);
                printf("ACCESS GRANTED!!!");
                getch();
                clrscr();

                gotoxy(20,10);
                printf("WELCOME TO MY HIDDEN FILES!!!");
                getch();
                clrscr();

                do
                {
                    gotoxy(20,24);
                    printf("DO YOU WANT TO CONTINUE?  (Y/N)");
                    ans=getche();

                    if(ans=='N' || ans=='n')
                    {
                        break;
                    }

                    clrscr();

                     for(count3=0;count3<5;count3++,a++,b++,c++,d++,e++)
                     {
                        printf("\nENTER STUDENTS NAME:  ");
                        times=0;

                        do
                        {
                            temp=getch();

                            if(isalpha(temp))
                            {
                                printf("%c",temp);
                                name[times][count3]=temp;
                                times++;

                            }
                        }    while(temp!='\r' && times<5 && temp!='0');

                        if(temp=='0')
                            break;

                     printf("\nENTER QUIZ 1: ");
                     scanf("%f",&q1[count3]);

                     printf("\nENTER QUIZ 2: ");
                     scanf("%f",&q2[count3]);

                     printf("\nENTER QUIZ 3: ");
                     scanf("%f",&q3[count3]);

                     studave[count3]=(q1[count3]+q2[count3]+q3[count3])/3;
                     sum1=sum1+q1[count3];
                     sum2=sum2+q2[count3];
                     sum3=sum3+q3[count3];

                     }

                     clrscr();

                     gotoxy(5,2);
                     printf("STUDENTS NAME");

                     gotoxy(25,2);
                     printf("QUIZ 1");

                     gotoxy(35,2);
                     printf("QUIZ 2");

                     gotoxy(45,2);
                     printf("QUIZ 3");

                     gotoxy(55,2);
                     printf("STUDENTS AVERAGE");

                        for(count3=0;count3<5;count3++,a++,b++,c++,d++,e++)
                        {
                            gotoxy(8,a);
                            printf("%s",name[count3]);

                            gotoxy(26,b);
                            printf("%.2f",q1[count3]);

                            gotoxy(36,c);
                            printf("%.2f",q2[count3]);

                            gotoxy(46,d);
                            printf("%.2f",q3[count3]);

                            gotoxy(58,e);
                            printf("%.2f",studave[count3]);
                        }

                        ave1=sum1/count3;
                        ave2=sum2/count3;
                        ave3=sum3/count3;

                        gotoxy(5,20);
                        printf("QUIZ AVERAGE");

                        gotoxy(26,20);
                        printf("%.2f",ave1);

                        gotoxy(36,20);
                        printf("%.2f",ave2);

                        gotoxy(46,20);
                        printf("%.2f",ave3);

                }    while(ans=='Y' || ans=='y');

            }

            else
            {
                clrscr();

                printf("ACCESS DENIED!!!");
                count1+=1;

                if(count1>=3)
                {
                    printf("\nUSER'S BLOCKED!!!");
                    break;
                }
            }

            count2=0;

        }    while(strcmp(pass,password)!=0);

        getch();
        clrscr();
    }
Sorry If It's Just Photo, I Can't Post The Whole Thing...

Please, By All Means, Any Help Is Appreciatted.

I Set To Take A Photo For The Program, For A Better Readable Way...

This Is My New Program, And Again I'm Asking For Help On Explaining Every Little Detail, And Again, Please Guys ...

And On The Other Hand, I Also Want To Ask For Help On Correcting It.

This Program Is Used For Computing Quiz Scores And Outputing The Average Per Student, Every Time I Input At Least Three Student Names, The Program Computes For Five Students...

Here Is The SS About The Problem...
I Inputed, Ivan, Sally, Kim...
And Here What Happens next... So Bad...
Quote:
__________________
Quote:
Originally Posted by KyleHavok View Post
One was already flamed to a crisp.

The other is in the process of being flamed to a crispier crisp.

Go figure.
That's what people get when they mess with the "Gravity".
Kill Aurora Blade!.
- - - - -
R.O.S.E. OnLine Evolution: http://www.onrpg.com/boards/95254.html
RAGNARÖK OnLine RPG™: http://www.onrpg.com/boards/82072.html UpDated!

Last edited by TheGW; 10-11-2007 at 02:20 AM. Reason: Just Change To Codes...
TheGW is offline   Reply With Quote