home   |   contact us   |   sitemap   |   advertising Free Online Games
Free MMORPG

The Free MMORPG Games- Free MMORPG - P2P Games - Open Beta - Closed Beta - Browser Based - Non-English - Other Free Games - Top 50


Go Back   Onrpg Free MMORPG Forums > Development > General Programming
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 10-10-2007, 03:49 AM   #1 (permalink)
TheGW
42
 
TheGW's Avatar
 
Join Date: Apr 2007
Location: Tacloban City, Leyte, Philippines 6500
Posts: 919
Reputation: 17
Send a message via Yahoo to TheGW
MMOFaces Profile: None Yet
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:
__________________

R.O.S.E. OnLine Evolution: UpDated!
http://www.onrpg.com/boards/95254.html

RAGNARÖK OnLine RPG™
http://www.onrpg.com/boards/82072.html


Help And Join The Revival Team For:
SAGA OF RYZOM And RYZOM RING
http://www.onrpg.com/boards/80543.html

Last edited by TheGW : 10-11-2007 at 02:20 AM. Reason: Just Change To Codes...
TheGW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2007, 04:14 AM   #2 (permalink)
Eriond
Snakes Big Toe
 
Eriond's Avatar
 
Join Date: May 2006
Location: Canada
Posts: 444
Reputation: 17
Send a message via MSN to Eriond
MMOFaces Profile: None Yet
Default

If the program suddenly takes over and starts having a mind of it's own, it's probably a segmentation fault. Check to see that you have enough memory allocated for all your variables. But, uh, your code is a little jumbled. Try organizing it into separate functions, and try indenting every time you hit a { and backspacing every time you hit a }. It'll make it a lot more readable.
__________________
This was a triumph. I'm making a note here, HUGE SUCCESS.

Outsider
3D Space Shooter/RPG in Development
http://advena.awardspace.com/
Eriond is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2007, 11:06 AM   #3 (permalink)
TheGW
42
 
TheGW's Avatar
 
Join Date: Apr 2007
Location: Tacloban City, Leyte, Philippines 6500
Posts: 919
Reputation: 17
Send a message via Yahoo to TheGW
MMOFaces Profile: None Yet
Thumbs up Well...

I Use Photos To See The Clear Indention...
__________________

R.O.S.E. OnLine Evolution: UpDated!
http://www.onrpg.com/boards/95254.html

RAGNARÖK OnLine RPG™
http://www.onrpg.com/boards/82072.html


Help And Join The Revival Team For:
SAGA OF RYZOM And RYZOM RING
http://www.onrpg.com/boards/80543.html
TheGW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-10-2007, 08:52 PM   #4 (permalink)
Shattered Skies
Snakes Big Toe
 
Shattered Skies's Avatar
 
Join Date: May 2006
Location: Indiana, USA
Posts: 442
Reputation: 10
Send a message via ICQ to Shattered Skies Send a message via AIM to Shattered Skies Send a message via MSN to Shattered Skies Send a message via Yahoo to Shattered Skies
MMOFaces Profile: None Yet
Default

It would probably be more beneficial for you just to copy the code and wrap it in CODE tags. Its hard to take a picture and help you debug your program. Especially one in broken sections. Pretty sure I wouldnt take each picture and try to photoshop them together then retype the code. Not worth the time.

From the console screenshot, though, looks like it might be some problem with the way the students name is being displayed (vertically instead of horizontally). So possibly some array problem.

[edit]And just because I feel like pointing it out... can you please stop capitalizing every word you type out?[/edit]
__________________


Quote:
Originally Posted by The Bible, John 15:13
Greater love hath no man than this, that a man lay down his life for his friends.
Quote:
Originally Posted by Proverb
Better a thousand times careful than once dead.
If you'd like to see a hardware forum added, go to one of these links and post:
http://www.onrpg.com/boards/71639.html
http://www.onrpg.com/boards/86137.html

Last edited by Shattered Skies : 10-10-2007 at 08:54 PM.
Shattered Skies is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-11-2007, 02:21 AM   #5 (permalink)
TheGW
42
 
TheGW's Avatar
 
Join Date: Apr 2007
Location: Tacloban City, Leyte, Philippines 6500
Posts: 919
Reputation: 17
Send a message via Yahoo to TheGW
MMOFaces Profile: None Yet
Unhappy Here Again...

I Used The Suggestion Of Shattered Skies...
Please Guys...
__________________

R.O.S.E. OnLine Evolution: UpDated!
http://www.onrpg.com/boards/95254.html

RAGNARÖK OnLine RPG™
http://www.onrpg.com/boards/82072.html


Help And Join The Revival Team For:
SAGA OF RYZOM And RYZOM RING
http://www.onrpg.com/boards/80543.html
TheGW is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-15-2007, 05:27 PM   #6 (permalink)
TK-416
Samus' Girdle
 
TK-416's Avatar
 
Join Date: Oct 2007
Location: kaschyyyk
Posts: 35
Reputation: 10
Send a message via ICQ to TK-416 Send a message via MSN to TK-416
MMOFaces Profile: None Yet
Default

Quote:
Originally Posted by TheGW View Post
I Used The Suggestion Of Shattered Skies...
Please Guys...
well im still very nooblike to that but this line seems strange >>float q1[5],q2[5],q3[5];<< well did you try it out without those [5]?
TK-416 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 04:15 AM.

Forums Section List
Main Category Free Games Online Games Upcoming Games Online Games Upcoming Games
General Free MMORPG Fiesta Online    Maple Story Guides Trickster DOMO - Dream of Mirror Online
RolePlaying Free MMO & MMOFPS Conquer Online    Maple Story Buy/Sell/Trade WarRock Online Seal Online
Newbie Zone Korean/Foreign Games DragonGem Lunia World of Warcraft Age of Armor
  Browser/MUDs FlyFF Ragnarok Online Other Games Exteel
  Single Player RPGs Ghost Online Rakion    Rappelz Infinity
  Free MMORPG Requests Guildwars Runescape    Final Fantasy XI Cabal Online
    Gunz Online Scions of Fate (YulGang)    Goonzu Online Granado Espada
    Maple Story Silkroad    Gunbound Nostale



Powered by vBulletin® Version 3.6.10
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.0.0 RC8
Onrpg, Copyright ©2003-2007, BlueCastle Media

Copyright © 2004-2007 BlueCastle Media