Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
C++
#include <stdio.h>
#include <conio.h>
#include <iostream.h>

int main()
{
        
	char one,two,three,four,five,six,seven,eight,nine,ten,onee,twoe;
    int o,t,th,f,fi;
    int fil,eng,math,sci,ap,tle,mapeh,val,comp,research,adv_bio,ex;
 	float finalgrade,fgfil,fgmath,fgsci,fgap,fgtle,fgmapeh,fgval,fgcomp,fgresearch,fgadv_bio,fgeng,overall;
	printf("\n\n\t\t\tWelcome to the LK System\n\n\tPlease Choose letter of your desired program\n\na)Brain Games\n\nb)Mindreader\n\nc)Grade Solver\n\n");
	scanf("%s",&onee);
	system("cls");
	switch (onee)
	{
	
	case 'a':
         	printf("\n\n\t\t\tWelcome to the Braingames\n\n\nIn this game,Where gonna test how big is your brain.\n\nJust answer the ff questions\n\n\n1.What is the family name of the First President of Russia?\n\na)Putin\t\tc)Yeltsin\n\nb)Medcedev\tYour Answer:\t");
	scanf("%s",&one);
	switch (one)
	{
	
	case 'a':
		printf("\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\nYour answer is Wrong\n\nCorrect Answer:\tPutin\n");
	   
}
 		printf("\n\n\n2.Who is the Second President of the United States?\n\na)George Washington\t\tc)John Adams\n\nb)Richard Nixon\t\t\tYour Answer:\t");
	scanf("%s",&two);
	switch (two)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: John Adams\n");
	   
}   
 		printf("\n\n\n3.Ramon Magsaysay is the_____ Presdient of the Philippines\n\na)7th\t\tc)9th\n\nb)6th:\t\tYour Answer:\t");
	scanf("%s",&three);
	switch (three)
	{
	
	case 'a':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: 7th\n");
}
 	   printf("\n\n\n4.What is the first cellphone developed by Samsung?\n\na)Mobira Talkman\t\tc)TU 500\n\nb)SH - 100\t\t\tYour Answer:\t");
	scanf("%s",&four);
	switch (four)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: SH - 100\n");	   
}
 	    printf("\n\n\n5.Which is correct:\n\na)White is the eggyolk\t\tc)None of the above\n\nb)Eggyolk is the white\t\t\tYour Answer:\t");
	scanf("%s",&five);
	switch (five)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tc:\tThe Eggyolk is yellow\n");	   
}
 	   	    printf("\n\n\n6.Before Mount Everest was discovered,what was The Hightest Mountain of the\tWorld?:\n\na)Mount Fuji\t\tc)Mauna Laua\n\nb)Yellowstone\t\td)None of the Above\t\tYour Answer:\t");
	scanf("%s",&six);
	switch (six)
	{
	
	case 'd':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tnone:\tMount Everest was still the Tallest Mountain\n");	   
}
    printf("\n\n\n7.One of the Inventors of the Internet\n\na)Richard Stallman\t\tc)Vint Cerf\n\nb)Ken Thompson\t\t\tYour Answer:\t");
	scanf("%s",&seven);
	switch (seven)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tVint Cerf\n");	   
}
    printf("\n\n\n8.Place where the first guns were created\n\na)Russia\t\tc)Japan\n\nb)China\t\t\tYour Answer:\t");
	scanf("%s",&eight);
	switch (eight)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tChina\n");	   
}
 	 printf("\n\n\n9.Can you take a picture with a wooden leg?\n\na)Yes\t\tc)Not sure\n\nb)No\t\tYour Answer:\t");
	scanf("%s",&nine);
	switch (nine)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tNo:You can't take a picture using a wooden leg\n");	   
}   
	 	 printf("\n\n\n10.Who is the founder of apple?\n\na)Bill Gates\t\tc)Markus Persson\n\nb)Steve Jobbs\t\td)None of the above\tYour Answer:\t");
	scanf("%s",&ten);
	switch (ten)
	{
	
	case 'd':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tNone:\t Steve Jobs is not Steve Jobbs\n");
      
       
       
       
       	
      
}
 
{	
	case 'b':
    
    
    printf("Pick a number from 1 to 15. Please enter any key to proceed. 1 = yes and 0 = no");
    
    
    printf("\n\n\nIs your number here?\n\n3   10   14   15   5   12   4   2   11\n\n\tYour answer:\t");
    scanf("%d",&o);
     printf("\n\n\nIs your number here?\n\n5   9   12   8   1   11   7    3    4\n\n\tYour answer:\t");
    scanf("%d",&t);
     printf("\n\n\nIs your number here?\n\n4   9   6   13   1   15   2   5   12\n\n\tYour answer:\t");
    scanf("%d",&th);
     printf("\n\n\nIs your number here?\n\n7   15   10   9   6   1   5   3   2\n\n\tYour answer:\t");
    scanf("%d",&f);
     printf("\n\n\nIs your number here?\n\n4   8   14   10   13   3   11   7   1   2   6\n\n\tYour answer:\t");
    scanf("%d",&fi);
    {
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 1!!!!!");
    if (o == 1 && t == 0 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 2!!!!!");
    if (o == 1 && t == 1 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 3!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 4!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 5!!!!!");
    if (o == 0 && t == 0 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 6!!!!!");
    if (o == 0 && t == 1 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 7!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 8!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 9!!!!!");
    if (o == 1 && t == 0 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 10!!!!!");
    if (o == 1 && t == 1 && th == 0 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 11!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 0 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 12!!!!!");
    if (o == 0 && t == 0 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 13!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 14!!!!!");
    if (o == 1 && t == 0 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 15!!!!!");
}  
{   
    case 'c':
    printf("Enter filipino grade:\t\t");
 	scanf("%d",&fil);
 	if (fil > 92)
	   printf("\n\n\t\t\t\tTaas ba\n********************************************************************************\n");
	
	if (fil < 92)
	   printf("\n\n\tNubo haw?\n************************************************************************\n");
 	printf("\nEnter English grade:\t\t");
 	scanf("%d",&eng);
 	if (eng > 92)
	   printf("\n\n\tYour a genius!\n************************************************************************\n");
	
	if (eng < 92)
	   printf("\n\n\tPinoy tuod\n************************************************************************\n");
 	printf("\nEnter Math grade:\t\t");
 	scanf("%d",&math);
 	if (math > 92)
	   printf("\n\n\tEngineer utok ya ba\n************************************************************************\n");
	
	if (math < 92)
	   printf("\n\n\tAhay...\n************************************************************************\n");
 	printf("\nEnter Science Grade\t\t");
 	scanf("%d",&sci);
 	if (sci > 92)
	   printf("\n\n\tEinstein maalam\n************************************************************************\n");
	
	if (sci < 92)
	   printf("\n\n\tPalatuon gid man\n************************************************************************\n");
 	printf("\nEnter Aral Pan grade:\t\t");
 	scanf("%d",&ap);
 	if (ap > 92)
	   printf("\n\n\tHISTORIAN!!!\n************************************************************************\n");
	
	if (ap < 92)
	   printf("\n\n\t0K lng na\n************************************************************************\n");
	printf("\nEnter TlE grade:\t\t");
 	scanf("%d",&tle);
 	if (tle > 92)
	   printf("\n\n\tNamit luto mo guro ay?\n************************************************************************\n");
	
	if (tle < 92)
	   printf("\n\n\tKulang pa asin luto mo day\n************************************************************************\n");
 	printf("\nEnter Mapeh grade:\t\t");
 	scanf("%d",&mapeh);
 	if (mapeh > 92)
	   printf("\n\n\tAlam ka na ah\n************************************************************************\n");
	
	if (mapeh < 92)
	   printf("\n\n\tAmo na lang ni nubo pa?\n************************************************************************\n");
 	printf("\nEnter Val Ed grade:\t\t");
 	scanf("%d",&val);
 	if (val > 92)
	   printf("\n\n\tPa Heaven ka na guro bwas\n************************************************************************\n");
	
	if (val < 92)
	   printf("\n\n\tOyyyy bad\n************************************************************************\n");
 	printf("\nEnter Computer grade:\t\t");
 	scanf("%d",&comp);
 	if (comp > 92)
	   printf("\n\nMa'am Lacson Jr.\n************************************************************************\n");
	
	if (comp < 92)
	   printf("\n\n\tAlay sa kamot ma type beh mo\n************************************************************************\n");
 	printf("\nEnter Research grade:\t\t");
 	scanf("%d",&research);
 	if (research > 92)
	   printf("\t\n\nIkaw na gid ya\n************************************************************************\n");
	
	if (research < 92)
	   printf("\n\n\tWala na ni ya duda ya\n************************************************************************\n");
 	printf("\nEnter Advance Bio grade:\t");
	scanf("%d",&adv_bio);
	if (adv_bio > 92)
	   printf("\n\n\tScientist\n************************************************************************\n");   
	
	if (adv_bio < 92)
	   printf("\n\n\tWala mn ko gni may ma inchindihan sa report\n************************************************************************\n");
	printf("\n\n\n\n\n Computing.....1....2....3....4\n\n\n\n");   
 	fgfil = fil * 1.2;
 	fgeng = eng * 1.2;
 	fgmath = math * 1.2;
 	fgsci = sci * 1.2;
 	fgap = ap * 0.9;
 	fgtle = tle * 1.2;
 	fgmapeh = mapeh * 1.2;
 	fgval= val * 0.9;
 	fgcomp = comp * 0.6;
 	fgresearch = research * 0.9;
 	fgadv_bio = adv_bio * 0.9;
 	overall = fgfil + fgeng + fgmath + fgsci + fgap + fgtle + fgmapeh + fgval + fgcomp + fgresearch + fgadv_bio;
 	finalgrade = overall/11.4;
 	system("cls");
	printf("\n\n\n\n\n\t\t\tYour final grade is %.3f",finalgrade); 
	if (finalgrade > 92)
	   printf("\n\t\t\tCongrats Honorol ba");
	
	if (finalgrade < 92)
	   printf("\n\t\t\tTuon pa tudo ahh");
    
}    
    
    
    
    
    

    

}

      

 getch();
}
}


What I have tried:

C++
#include <stdio.h>
#include <conio.h>
#include <iostream.h>

int main()
{
        
	char one,two,three,four,five,six,seven,eight,nine,ten,onee,twoe;
    int o,t,th,f,fi;
    int fil,eng,math,sci,ap,tle,mapeh,val,comp,research,adv_bio,ex;
 	float finalgrade,fgfil,fgmath,fgsci,fgap,fgtle,fgmapeh,fgval,fgcomp,fgresearch,fgadv_bio,fgeng,overall;
	printf("\n\n\t\t\tWelcome to the LK System\n\n\tPlease Choose letter of your desired program\n\na)Brain Games\n\nb)Mindreader\n\nc)Grade Solver\n\n");
	scanf("%s",&onee);
	system("cls");
	switch (onee)
	{
	
	case 'a':
         	printf("\n\n\t\t\tWelcome to the Braingames\n\n\nIn this game,Where gonna test how big is your brain.\n\nJust answer the ff questions\n\n\n1.What is the family name of the First President of Russia?\n\na)Putin\t\tc)Yeltsin\n\nb)Medcedev\tYour Answer:\t");
	scanf("%s",&one);
	switch (one)
	{
	
	case 'a':
		printf("\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\nYour answer is Wrong\n\nCorrect Answer:\tPutin\n");
	   
}
 		printf("\n\n\n2.Who is the Second President of the United States?\n\na)George Washington\t\tc)John Adams\n\nb)Richard Nixon\t\t\tYour Answer:\t");
	scanf("%s",&two);
	switch (two)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: John Adams\n");
	   
}   
 		printf("\n\n\n3.Ramon Magsaysay is the_____ Presdient of the Philippines\n\na)7th\t\tc)9th\n\nb)6th:\t\tYour Answer:\t");
	scanf("%s",&three);
	switch (three)
	{
	
	case 'a':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: 7th\n");
}
 	   printf("\n\n\n4.What is the first cellphone developed by Samsung?\n\na)Mobira Talkman\t\tc)TU 500\n\nb)SH - 100\t\t\tYour Answer:\t");
	scanf("%s",&four);
	switch (four)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer: SH - 100\n");	   
}
 	    printf("\n\n\n5.Which is correct:\n\na)White is the eggyolk\t\tc)None of the above\n\nb)Eggyolk is the white\t\t\tYour Answer:\t");
	scanf("%s",&five);
	switch (five)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tc:\tThe Eggyolk is yellow\n");	   
}
 	   	    printf("\n\n\n6.Before Mount Everest was discovered,what was The Hightest Mountain of the\tWorld?:\n\na)Mount Fuji\t\tc)Mauna Laua\n\nb)Yellowstone\t\td)None of the Above\t\tYour Answer:\t");
	scanf("%s",&six);
	switch (six)
	{
	
	case 'd':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tnone:\tMount Everest was still the Tallest Mountain\n");	   
}
    printf("\n\n\n7.One of the Inventors of the Internet\n\na)Richard Stallman\t\tc)Vint Cerf\n\nb)Ken Thompson\t\t\tYour Answer:\t");
	scanf("%s",&seven);
	switch (seven)
	{
	
	case 'c':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tVint Cerf\n");	   
}
    printf("\n\n\n8.Place where the first guns were created\n\na)Russia\t\tc)Japan\n\nb)China\t\t\tYour Answer:\t");
	scanf("%s",&eight);
	switch (eight)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tChina\n");	   
}
 	 printf("\n\n\n9.Can you take a picture with a wooden leg?\n\na)Yes\t\tc)Not sure\n\nb)No\t\tYour Answer:\t");
	scanf("%s",&nine);
	switch (nine)
	{
	
	case 'b':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tNo:You can't take a picture using a wooden leg\n");	   
}   
	 	 printf("\n\n\n10.Who is the founder of apple?\n\na)Bill Gates\t\tc)Markus Persson\n\nb)Steve Jobbs\t\td)None of the above\tYour Answer:\t");
	scanf("%s",&ten);
	switch (ten)
	{
	
	case 'd':
		printf("\n\nYour answer is correct\n");
		break;
	   
    default:
	   printf("\n\nYour answer is Wrong\n\nCorrect Answer:\tNone:\t Steve Jobs is not Steve Jobbs\n");
      
       
       
       
       	
      
}
 
{	
	case 'b':
    
    
    printf("Pick a number from 1 to 15. Please enter any key to proceed. 1 = yes and 0 = no");
    
    
    printf("\n\n\nIs your number here?\n\n3   10   14   15   5   12   4   2   11\n\n\tYour answer:\t");
    scanf("%d",&o);
     printf("\n\n\nIs your number here?\n\n5   9   12   8   1   11   7    3    4\n\n\tYour answer:\t");
    scanf("%d",&t);
     printf("\n\n\nIs your number here?\n\n4   9   6   13   1   15   2   5   12\n\n\tYour answer:\t");
    scanf("%d",&th);
     printf("\n\n\nIs your number here?\n\n7   15   10   9   6   1   5   3   2\n\n\tYour answer:\t");
    scanf("%d",&f);
     printf("\n\n\nIs your number here?\n\n4   8   14   10   13   3   11   7   1   2   6\n\n\tYour answer:\t");
    scanf("%d",&fi);
    {
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 1!!!!!");
    if (o == 1 && t == 0 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 2!!!!!");
    if (o == 1 && t == 1 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 3!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 4!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 5!!!!!");
    if (o == 0 && t == 0 && th == 1 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 6!!!!!");
    if (o == 0 && t == 1 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 7!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 8!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 9!!!!!");
    if (o == 1 && t == 0 && th == 0 && f == 1 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 10!!!!!");
    if (o == 1 && t == 1 && th == 0 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 11!!!!!");
    if (o == 1 && t == 1 && th == 1 && f == 0 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 12!!!!!");
    if (o == 0 && t == 0 && th == 1 && f == 0 && fi == 1 )
    printf("\n\n\n\t\t\tYour number is 13!!!!!");
    if (o == 0 && t == 1 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 14!!!!!");
    if (o == 1 && t == 0 && th == 1 && f == 1 && fi == 0 )
    printf("\n\n\n\t\t\tYour number is 15!!!!!");
}  
{   
    case 'c':
    printf("Enter filipino grade:\t\t");
 	scanf("%d",&fil);
 	if (fil > 92)
	   printf("\n\n\t\t\t\tTaas ba\n********************************************************************************\n");
	
	if (fil < 92)
	   printf("\n\n\tNubo haw?\n************************************************************************\n");
 	printf("\nEnter English grade:\t\t");
 	scanf("%d",&eng);
 	if (eng > 92)
	   printf("\n\n\tYour a genius!\n************************************************************************\n");
	
	if (eng < 92)
	   printf("\n\n\tPinoy tuod\n************************************************************************\n");
 	printf("\nEnter Math grade:\t\t");
 	scanf("%d",&math);
 	if (math > 92)
	   printf("\n\n\tEngineer utok ya ba\n************************************************************************\n");
	
	if (math < 92)
	   printf("\n\n\tAhay...\n************************************************************************\n");
 	printf("\nEnter Science Grade\t\t");
 	scanf("%d",&sci);
 	if (sci > 92)
	   printf("\n\n\tEinstein maalam\n************************************************************************\n");
	
	if (sci < 92)
	   printf("\n\n\tPalatuon gid man\n************************************************************************\n");
 	printf("\nEnter Aral Pan grade:\t\t");
 	scanf("%d",&ap);
 	if (ap > 92)
	   printf("\n\n\tHISTORIAN!!!\n************************************************************************\n");
	
	if (ap < 92)
	   printf("\n\n\t0K lng na\n************************************************************************\n");
	printf("\nEnter TlE grade:\t\t");
 	scanf("%d",&tle);
 	if (tle > 92)
	   printf("\n\n\tNamit luto mo guro ay?\n************************************************************************\n");
	
	if (tle < 92)
	   printf("\n\n\tKulang pa asin luto mo day\n************************************************************************\n");
 	printf("\nEnter Mapeh grade:\t\t");
 	scanf("%d",&mapeh);
 	if (mapeh > 92)
	   printf("\n\n\tAlam ka na ah\n************************************************************************\n");
	
	if (mapeh < 92)
	   printf("\n\n\tAmo na lang ni nubo pa?\n************************************************************************\n");
 	printf("\nEnter Val Ed grade:\t\t");
 	scanf("%d",&val);
 	if (val > 92)
	   printf("\n\n\tPa Heaven ka na guro bwas\n************************************************************************\n");
	
	if (val < 92)
	   printf("\n\n\tOyyyy bad\n************************************************************************\n");
 	printf("\nEnter Computer grade:\t\t");
 	scanf("%d",&comp);
 	if (comp > 92)
	   printf("\n\nMa'am Lacson Jr.\n************************************************************************\n");
	
	if (comp < 92)
	   printf("\n\n\tAlay sa kamot ma type beh mo\n************************************************************************\n");
 	printf("\nEnter Research grade:\t\t");
 	scanf("%d",&research);
 	if (research > 92)
	   printf("\t\n\nIkaw na gid ya\n************************************************************************\n");
	
	if (research < 92)
	   printf("\n\n\tWala na ni ya duda ya\n************************************************************************\n");
 	printf("\nEnter Advance Bio grade:\t");
	scanf("%d",&adv_bio);
	if (adv_bio > 92)
	   printf("\n\n\tScientist\n************************************************************************\n");   
	
	if (adv_bio < 92)
	   printf("\n\n\tWala mn ko gni may ma inchindihan sa report\n************************************************************************\n");
	printf("\n\n\n\n\n Computing.....1....2....3....4\n\n\n\n");   
 	fgfil = fil * 1.2;
 	fgeng = eng * 1.2;
 	fgmath = math * 1.2;
 	fgsci = sci * 1.2;
 	fgap = ap * 0.9;
 	fgtle = tle * 1.2;
 	fgmapeh = mapeh * 1.2;
 	fgval= val * 0.9;
 	fgcomp = comp * 0.6;
 	fgresearch = research * 0.9;
 	fgadv_bio = adv_bio * 0.9;
 	overall = fgfil + fgeng + fgmath + fgsci + fgap + fgtle + fgmapeh + fgval + fgcomp + fgresearch + fgadv_bio;
 	finalgrade = overall/11.4;
 	system("cls");
	printf("\n\n\n\n\n\t\t\tYour final grade is %.3f",finalgrade); 
	if (finalgrade > 92)
	   printf("\n\t\t\tCongrats Honorol ba");
	
	if (finalgrade < 92)
	   printf("\n\t\t\tTuon pa tudo ahh");
    
}    
    
    
    
    
    

    

}

      

 getch();
}
}
Posted
Updated 24-Jan-17 0:26am
v3
Comments
nv3 22-Jan-17 7:42am    
Where is your problem. Just post the fraction of code that you have problems with. I guess nobody will take the time to read and run your entire program. Get familiar with the debugger so that you can pinpoint the problem.
[no name] 22-Jan-17 8:13am    
Nope, we aren't a "debug my homework assignment codebase for me" service. Learn to use the debugger and it will help find and fix the bugs in your code.
Stefan_Lang 26-Jan-17 8:36am    
In order to help you, we normally at least need some description of what is going wrong. So: what did you expect? What happened instead? What did you try to help limit the possible reasons for this unexpected behaviour.

Without that information, every attempt of an answer is just a stab in the dark. And that is why most of the responses were so negative.

I tried in - spite of that - to get an idea what your program is doing, and I noticed that you made an error in all of your scanf statements: see solution 3. I can't say if it fixes your problem since you didn't say what your problem is, but please take a look and accept the answer if it solves your problem.

No. Partly because I'm not running code from a total stranger on my machine without a very careful look at what it does, partly because I don't know what it does wrong, and mostly I have no idea what it is supposed to do, so probably wouldn't notice a problem anyway...

This is your task, your problem - and you should use the debugger to work out what the problem is and how to fix it.
So, its going to be up to you.
Put a breakpoint on the first line in the function, and run your code through the debugger. Then look at your code, and at your data and work out what should happen manually. Then single step each line checking that what you expected to happen is exactly what did. When it isn't, that's when you have a problem, and you can back-track (or run it again and look more closely) to find out why.

Sorry, but we can't do that for you - time for you to learn a new (and very, very useful) skill: debugging!
 
Share this answer
 
v2
Comments
Member 12962080 22-Jan-17 8:36am    
but sir I am just highschool that I am gonna pass TOMORROW where in the only things I know in c++ is printf,scanf,declaring variables,case function,if else statements and thats ALL.
OriginalGriff 22-Jan-17 8:55am    
That is your problem, not mine. Perhaps you should have studied your course, and planned your time a little better?
We are not here to get students through a course they do not understand.
So get on with it, and start with the debugger. You probably have enough time, if you don't spend it all in an unsuccessful attempt to get others to do it all for you...
Quote:
I have a problem of how my program works in dev c++.
Your app behave exactly as it is programmed for.
It is impossible to help you because you only forgot to explain what is your expectation. Without this information, finding what is wrong is a guessing game. With best will, nobody can reasonably find what is wrong.
An explanation of what is the unexpected behavior is also an advantage, so that helpers can narrow the research, but you also forgot.

When you don't understand what your code is doing or why it does what it does, the answer is debugger.
Use the debugger to see what your code is doing. It allow you to execute lines 1 by 1 and to inspect variables as it execute, it is an incredible learning tool.

Debugger - Wikipedia, the free encyclopedia[^]
Mastering Debugging in Visual Studio 2010 - A Beginner's Guide[^]

The debugger is here to show you what your code is doing and your task is to compare with what it should do.
There is no magic in the debugger, it don't find bugs, it just help you to. When the code don't do what is expected, you are close to a bug.
 
Share this answer
 
Be careful when using scanf (and printf) using format strings and make sure that the format specifiers actually match the parameter types: in your program, you repeatedly use scanf with the format specifier %s which denotes a string (or array) of char, including the terminating 0-byte - but you do not pass a variable of that type! Instead you pass char variables, and that will lead to undefined behaviour at runtime.

Either use %c (single character) or use char arrays large enough to hold a 0-byte in addition to the amount of characters you expect to read. See scanf - C++ Reference[^]

P.S.: why don't you simply use std::cout and std::cin instead? You did include iostream - what for if not for that?
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900