[13ÇÐ¹ø ±âÁØ]

var not_selected = "not_selected";
var direct_input = "Á÷Á¢ÀÔ·Â";
var subject_section = {
	"Àü°øÇÙ½É":not_selected+",±âº»ÇÁ·Î±×·¡¹Ö,ÄÄÇ»ÅÍ±³À°°³·Ð,ÀÚ·á±¸Á¶,ÄÄÇ»ÅÍ±¸Á¶,µ¥ÀÌÅ¸º£ÀÌ½º,¿î¿µÃ¼Á¦,ÄÄÇ»ÅÍ³×Æ®¿öÅ©,ÇÁ·Î±×·¡¹Ö¾ð¾î·Ð",
	"Àü°øÀÏ¹Ý":not_selected+",»ó¾÷Á¤º¸±³°ú³í¸®³í¼ú,ÄÄÇ»ÅÍ±³°ú±³À°·Ð,ÄÄÇ»ÅÍ±³Àç¿¬±¸¹×Áöµµ¹ý,"+direct_input,
	"±³¾ç":not_selected+",À¯ÇÐ»ç»ó°ú°¡Ä¡°ü,ÀÇ»ç¼ÒÅë,Ã¢ÀÇ¿Í»çÀ¯,¸®´õ½Ê,±âº»¿µ¾î,Àü¹®¿µ¾î/±Û·Î¹ú¹®È­,±âÃÊÀÎ¹®»çÈ¸°úÇÐ,±âÃÊÀÚ¿¬°úÇÐ,ÀÎ°£¹®È­,»çÈ¸¿ª»ç,ÀÚ¿¬°úÇÐ±â¼ú,±âÅ¸±³¾ç",
	"±³Á÷":not_selected+",Æ¯¼ö±³À°ÇÐ°³·Ð,ÇÐ±³Æø·Â¿¹¹æ¹×ÇÐ»ýÀÇÀÌÇØ,±³Á÷½Ç¹«,±³À°ºÀ»çÈ°µ¿,±³À°½Ç½À,"+direct_input
}; 

var vals = [];
var table=[[[]]];
var totalCredit, totalGrade;
var able=true;

//CountSubjects·Î µéÀº °ú¸ñ¼ö ¼¼±â
function numofSubjects() {
var CountSubjects = 0;
for(var i=0;i<10;i++)
{
	for(var j=0;j<11;j++)
{	
if( table[ i ][ j ] == undefined)
break;
CountSubjects += 1;
}
}
return CountSubjects;
}

//ÃÑ µéÀº ÇÐÁ¡ÀÌ 140 ÇÐÁ¡ÀÌ ³Ñ´ÂÁö È®ÀÎ
function totalCredit() {
	var Credit=0;
for(var i=0;i<10;i++)
{
		for(var j=0;j<11;j++)
Credit += table[ i ][ j ][ 3 ];
}
if(Credit<140)
able=false;
}

//ÇÐÁ¡ Æò±Õ °è»ê
function avgGrade() {
	var Grade=0;
for(var i=0;i<10;i++)
{
	for(var j=0;j<11;j++)
Grade += table[ i ][ j ][ 4 ];
}
Grade = Grade / numofSubjects();
if(Grade<2.5)
able=false;
}

//Àü°øÇÙ½É Ã¼Å©
function checkCore(count)
{
	var check = true;
	vals = subject_section.Àü°øÇÙ½É.split(",");
	
	check(vals.length , vals);
}

//Àü°øÀÏ¹Ý(42ÇÐÁ¡ÀÎÁö) Ã¼Å©
function checkGeneral ()
{
	var credit=0;
	for ( var i=0; i < 10; i++)
	{
		for(var j=0; j<11 ; j++)
		{
			if( table[ i ][ j ][1] == ¡®Àü°øÀÏ¹Ý¡¯)
				credit += table[ i ][ j ][3];
			foreignLang(table[i][j][2]);
		}
	}

	if ( credit < 42)
		able = false;
}

//±³¾ç°ú¸ñ Ã¼Å©
function checkCulture()
{
	vals = subject_section.±³¾ç.split(",");

var count = 0;
for(var k=1; k<vals.length-1; k++) {
	count = 0;
	for ( var i=0; i < 10; i++)
	{
		for(var j=0; j<11 ; j++)
		{
			if( table[ i ][ j ][1] == ¡®vals[k]¡¯)
				count +=1;	
		}
	}
	if(vals[k]==¡¯±âº»¿µ¾î¡¯ || vals[k]==¡¯ÀÇ»ç¼ÒÅë¡¯ || vals[k]==¡¯±âÃÊÀÎ¹®»çÈ¸°úÇÐ¡¯)
		if( count < 2)
		able = false;
	else if(vals[k]==¡¯±âÃÊÀÚ¿¬°úÇÐ¡¯)
		if( count < 4)
		able = false;
else
	if( count < 1)
		able = false;
}
}

//±³Á÷ÀÌ·Ð Ã¼Å©
var cultures=[];
cultures=[¡®±³À°ÇÐ°³·Ð¡¯, ¡®±³À°ÀÇ¿ª»çÃ¶ÇÐÀûÀÌÇØ¡¯, ¡®±³À°ÀÇ»çÈ¸ÇÐÀûÀÌÇØ¡¯, ¡®±³À°ÀÇ½É¸®ÇÐÀûÀÌÇØ¡¯, ¡®±³À°°úÁ¤¡¯,  ¡®±³À°Æò°¡¡¯,  ¡®±³À°¹æ¹ý¹×±³À°°øÇÐ¡¯,  ¡®±³À°ÇàÁ¤¹×±³À°°æ¿µ¡¯]
function checkTeach()
{
	var count = 0;
	for ( var i=0; i < 10; i++)
		for(var j=0; j<11 ; j++)
			for(var k=0; k<8; k++)
if( table[i][j][1] == cultures[k] )
					count +=1;
	if( count < 6)
	able = false;
}

//±³Á÷¼Ò¾ç & ±³Á÷ ½Ç½À Ã¼Å©
function checkTeach2()
{	
	var check = true;
	vals = subject_section.±³Á÷.split(",");
	check( vals.length-1 , vals);
}

//°ú¸ñÀ» µé¾ú´ÂÁö ¾Èµé¾ú´ÂÁö¿¡ ´ëÇÑ ÇÔ¼ö
function check (var len, var subs[])
{
for ( var k=1; k<len; k++) {
		for ( var i=0; i < 10; i++) {
			for(var j=0; j<11 ; j++) 	{
				if( table[ i ][ j ][1] == subs[k]) break;
else check = false;
			}
			if ( table[ i ][ j ][1] == subs[k]) break;
		}
		if ( check == false) {
			able = false;
			break;
		}
}
}

//Àü°øÀÏ¹Ý°ú¸ñÁß ±¹Á¦¾î 1°ú¸ñÀÌ»ó µé¾ú´ÂÁö Ã¼Å©
function foreignLang (var subject)
{
	var foreign=[];
var count=0;
foreign=[¡°ÄÄÇ»ÅÍ¼ö¾÷¼³°è¹×¿¬½À¡±,¡±°´Ã¼ÁöÇâÇÁ·Î±×·¡¹Ö¡±,¡±ÄÄÆÄÀÏ·¯¡±,¡±ÄÄÇ»ÅÍ±×·¡ÇÈ½º¡±,¡±³í¸®È¸·Î¡±,¡±ºñÁÖ¾óÇÁ·Î±×·¡¹Ö¡±,¡±±³À°¿ë¸ÖÆ¼¹Ìµð¾î¡±,¡±ÀÎÅÍ³Ý¼­¹ö±¸Ãà·Ð¡±,¡±ÄÄÇ»ÅÍº¸¾È¡±,¡±¾Ë°í¸®Áò¡±];

for ( var k = 0 ; k < foreign.length ; k ++) {
if(foreign[k]==subject)
count ++;
	}

if(foreign<1)
		able=false;
}



////Ã¼Å©¹Ú½º////
3Ç° Y/N
½ÉÆó¼Ò»ý¼ú (ÀçÇÐÁß 2È¸ÀÌ»ó) Y/N
±³Á÷Àû¼ºÀÎ¼º°Ë»ç (ÀçÇÐÁß 2È¸ ÀÌ»ó) Y/N
ÀÚ°ÝÁõ Y/N











var subject_section = { µñ¼Å³Ê¸® };
var vals = [];
var table=[[[]]];
var count = 0;
var totalCredit, totalGrade;
var able=true;
vals = subject_section.Àü°øÇÙ½É.split(",");

function numofSubjects()
function totalCredit()
function avgGrade()
function checkCore(count)
function checkGeneral()
function checkCulture()
function checkTeachMajor()

function checkTeach()
function checkTeach2()
function check(var len)
function foreignLang()

