![]() |
homecontact ussitemapadvertising | |||
|
|
||||
The Free MMORPG Games- Free MMORPG - P2P Games - Open Beta - Closed Beta - Browser Based - Non-English - Other Free Games - Top 50
|
|||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|
#1 (permalink) | |
|
42
|
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();
}
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 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... |
|
|
|
|
|
|
#2 (permalink) |
|
Snakes Big Toe
|
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/ |
|
|
|
|
|
#3 (permalink) |
|
42
|
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 SAGA OF RYZOM And RYZOM RING http://www.onrpg.com/boards/80543.html |
|
|
|
|
|
#4 (permalink) | ||
|
Snakes Big Toe
|
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:
Quote:
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. |
||
|
|
|
|
|
#5 (permalink) |
|
42
|
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 SAGA OF RYZOM And RYZOM RING http://www.onrpg.com/boards/80543.html |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Copyright © 2004-2007 BlueCastle Media |