BCA

WEB PROGRAMMING LAB

PROGRAM 1 PROGRAM 2 PROGRAM 3 PROGRAM 4 PROGRAM 5 PROGRAM 6

PART B

PROGRAM 7 PROGRAM 8 PROGRAM 9 PROGRAM 10 PROGRAM 11 PROGRAM 12 PROGRAM 13 PROGRAM 14 PROGRAM 15 . . .

11. Twenty students studying in various courses have been shortlisted in a placement program conducted by a reputed company. Your task is to separate the students based on the course and count the students in each course who have been shortlisted
Input: Register number and name of twenty students.
Output: List of students (Register Number and Name) belonging to each course.
(Hint: One or two characters in register number indicates the course of the student)

OUTPUT:

PAGE 1: program11startpage.html

 
 
11. Twenty students studying in various courses have been shortlisted in a placement program
conducted by a reputed company. Your task is to separate the students based on the course and
count the students in each course who have been shortlisted 
Input: Register number and name of twenty students.< 
Output: List of students (Register Number and Name) belonging to each course. 
(Hint: One or two characters in register number indicates the course of the student)
	  <html>
<head>
<meta charset=utf-8 />
<title>p14</title>
<style>
body {padding-top:50px}
</style>
</head>

<body>
 <table id="student">
            <tr>
                <th>Student Name</th>
                <th>Register Number</th>
            </tr>
<tr>
<td><input type="text" id="text1" name="studentname[]" value="" /></td>
<td><input type="text" id="text2" name="registernumber[]" value=""/></td>
</tr>
</table>
<p id="m"></p>
<input type="button" id="button1" value="Add" onclick="add_element_to_array();"></input>
<input type="button" id="button2" value="Display" onclick="display_array();" ></input>
<div><label id="msgdisplay"></label></div>
<div id="Result"></div>
</body>


<script>
var x = 0;
var array = Array();
var regarray=Array();
function add_element_to_array()
{
    array[x] = document.getElementById("text1").value;
    regarray[x] = document.getElementById("text2").value; 
    //alert("Name:" + array[x] + "   "+ "Regno:" + regarray[x]);


    document.getElementById("msgdisplay").innerHTML = "Entered successfully";

    x++;

    document.getElementById("text1").value = "";
    document.getElementById("text2").value="";
 

var delaytime=1000;
    setTimeout(function(){

    document.getElementById("msgdisplay").innerHTML = "";
    },delaytime);

}// function

function display_array()
{
    var e = "<hr/>";
     for (var i=0; i<array.length; i++)
{
     e += "At index " + i + " = " + array[i] + " "+ " Reg= " + regarray[i] + "<br/>";
}



   e += "<hr/> BCA Student <hr/>";
 for (var i=0; i<array.length; i++)
{

    if(regarray[i].includes("bc"))
     e += "Name=  " + array[i] + " "+ " Reg= " + regarray[i] + "<br/>";
      console.log(regarray[i].includes("bc"));
}
      
     e += "<hr/> BA Student <hr/>";
     for (var i=0; i<array.length; i++)
{

 if(regarray[i].includes("ba"))
 e += "Name=  " + array[i] + " "+ " Reg= " + regarray[i] + "<br/>";

console.log(regarray[i].includes("ba"));
}

 


e += "<hr/> BSC Student <hr/>";
 for (var i=0; i<array.length; i++)
{

 if(regarray[i].includes("bs"))
 e += "Name=  " + array[i] + " "+ " Reg= " + regarray[i] + "<br/>";

console.log(regarray[i].includes("bs"));
}
 

 document.getElementById("Result").innerHTML = e;
 

}
</script>
</html>