Wednesday, March 21, 2012

GTU Sem 6 Question Papers-May 2011

This blog contains the question papers for 6th semester GTU students.

https://www.dropbox.com/home/GTU%20Sem-6%20I.T.%20Question%20Papers-May%202011 

G.T.U. Sem-6 I.T.E-Books

This blog contains the soft-copies of all the books for GTU 6th semester I.T. students.

M.S.O.R. ( H.A. Taha )
 

http://dl.dropbox.com/u/68380702/Operation%20Research%20H.A.%20Taha.pdf?dl=1

M.S.O.R. ( Hiller Leiberman )




http://dl.dropbox.com/u/68380702/Introduction%20to%20Operations%20Research%20%28Hillier%26Lieberman%29_E-Book.pdf?dl=1

Note:-
If this link don't work then remove "dl=1" appearing at the end of link.

Thursday, March 15, 2012

Result Calculator

This javascript generates the result of the student. It gives total, percentage and grade in the output for the marks of 5 subjects enetered as input.
Following is the javascript for the same.

<html>
<head>
<script language="javascript" type="text/javascript" />
function ok()
{
    name=(document.f1.t1.value);
    rollno=(document.f1.t2.value);
   
    a=Number(document.f1.t3.value);
    b=Number(document.f1.t4.value);
    c=Number(document.f1.t5.value);
    d=Number(document.f1.t6.value);
    e=Number(document.f1.t7.value);
   
    if(a<=0 || a>100)
        alert("the value of marks 1 is invalid");
    if(b<=0 || b>100)
        alert("the value of marks 2 is invalid");   
    if(c<=0 || c>100)
        alert("the value of marks 3 is invalid");
    if(d<=0 || d>100)
        alert("the value of marks 4 is invalid");
    if(e<=0 || e>100)
        alert("the value of marks 5 is invalid");
    total=a+b+c+d+e;
    t=document.f1.t8.value=total;
    per=total/5;
    p=document.f1.t9.value=per;
   
    if(per>=80)
        document.f1.t10.value="AA";
    else if(per>=70 && per<80)
        document.f1.t10.value="BB";
    else if(per>=60 && per<70)
        document.f1.t10.value="cc";
    else
        document.f1.t10.value="fail";
}   
 </script>
</head>
<body>
<form name="f1">
Name
<input type="text" name="t1" />
<br />
roll no
<input type="text" name="t2" />
<br />
marks1
<input type="text" name="t3" />
<br />
marks2
<input type="text" name="t4" />
<br />
marks3
<input type="text" name="t5" />
<br />
marks4
<input type="text" name="t6" />
<br />
marks5

<input type="text" name="t7" />
<br />
total
<input type="text" name="t8" />
<br />
percentage
<input type="text" name="t9" />
<br />
grade
<input type="text" name="t10" />

<br />
<input type="button" value="ok" onclick="ok();" />
 </body>
</html>

Calculator

This javascript generates the well-structured calculator with all types of operations and controls.
Following is the javascript for the same.

<html>
<head>
</head>

<body>
<form name="f1">
<table>
<tr> <td colspan="3"><input type="text" name="t1" /> </td>
    <td><input type="button" value="C" onclick="document.f1.t1.value=''"/> </td>
</tr>
<tr>
    <td><input type="button" value="1" onclick="document.f1.t1.value+='1'"/> </td>
    <td><input type="button" value="2" onclick="document.f1.t1.value+='2'"/> </td>
    <td><input type="button" value="3" onclick="document.f1.t1.value+='3'"/> </td>
    <td><input type="button" value="+" onclick="document.f1.t1.value+='+'"/> </td>
</tr>
<tr>
    <td><input type="button" value="4" onclick="document.f1.t1.value+='4'"> </td>
    <td><input type="button" value="5" onclick="document.f1.t1.value+='5'"/> </td>
    <td><input type="button" value="6" onclick="document.f1.t1.value+='6'"/> </td>
    <td><input type="button" value="-" onclick="document.f1.t1.value+='-'"/> </td>
</tr>
<tr>
    <td><input type="button" value="7" onclick="document.f1.t1.value+='7'"/> </td>
    <td><input type="button" value="8" onclick="document.f1.t1.value+='8'"/> </td>
    <td><input type="button" value="9" onclick="document.f1.t1.value+='9'"/> </td>
    <td><input type="button" value="*" onclick="document.f1.t1.value+='*'"/> </td>
</tr>
<tr>
        <td><input type="button" value="0" onclick="document.f1.t1.value+='0'"/> </td>
        <td><input type="button" value="." onclick="document.f1.t1.value+='1.'"/> </td>
        <td><input type="button" value="=" onclick="document.f1.t1.value=eval(f1.t1.value);"/> </td>
        <td><input type="button" value="/" onclick="document.f1.t1.value+='/'"/> </td>
</tr>
</table>
</form>   
   
</body>
</html>

Validations in Registration Form

This javascript validates any registration form.
For eg:-
  • If a user enters numbers in the text fiel in front Name, then it's invalid value assignment for the attribute Name.
    Following is the javascript for the same:-
<html>
<head>
<script language="javascript" type="text/javascript">
function validate()
{
/*if((document.f1.t1.value=="")||(document.f1.t2.value=="")||(document.f1.t3.value=="")||(document.f1.t4.value=="")||(document.f1.t5.value==""))
{
    alert("please fill ALL Details");
}*/
if(document.f1.t3.value=="")
{
    document.f1.l3.value="enter password";
}
if(document.f1.t3.value!=document.f1.t4.value )
{
        document.f1.l3.value="invalid password";
}
var a=document.f1.t1.value;
document.f1.l1.value=testchar(a);
function testchar(m)
{
    var p="^[a-zA-Z]*$";
    var r=new RegExp(p);
    return r.test(m);
}
var b=document.f1.t2.value;
document.f1.l2.value=testnum(b);
function testnum(n)
{
    var s="^[0-9]*$";
    var v=new RegExp(s);
    return v.test(n);
}
var c=document.f1.t5.value;
document.f1.l5.value=testmail(c);
function testmail(l)
{
    var t="^[\\w-_\*]\*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
    var x=new RegExp(t);
    return x.test(l);
}

}
</script>
</head>
<body>
<form name="f1">

Name
<input type="text" name="t1" height="100" width="100"/>
<input type="label" name="l1" height="100" width="100 " />
<br />
Contact
<input type="text" name="t2" />
<input type="label" name="l2" />
<br />
Password
<input type="text" name="t3" />
<input type="label" name="l3" />
<br />
Confirm password
<input type="text" name="t4" />
<input type="label" name="l4" />
<br />
E-mail
<input type="text" name="t5" />
<input type="label" name="l5" />
<br />
<input type="button" name="b1" value="ok" onclick="validate();" />

</form>
</body>
</html>
 

Fibonacci Series

This javascript generates the fibonacci series upto the given number.
Following is the javascript for the sane:-


<html>
 <head>
    <title>Fibonacci Series</title>
</head>
 <body>
    <script language="javascript" type="text/javascript">
   

        var a = 0;
        var b = 1;
        var c;

        var num = prompt("Enter the limit to generate fibonacci no",0);

        document.write(a+"<br />");
        document.write(b+"<br />");

        for(var i=3; i <= num;i++)
        {
            c = a + b;
            a = b;
            b = c;

            document.write(c+"<br />");
        }

    // -->
    </script>

 </body>
</html>

Odd numbers

This javascript generates the number of odd numbers between 1 & 100.
Following is the javascript for the same:-

<html>
<head>
<title>Odd Nos</title>
</head>
<body>
<script language="javascript" type="text/javascript">
var i,count=0;
for(i=0;i<100;i++)
{
if(i%2!=0)
{
count++;
}
document.write("No of odd nos bet'n 1 & 100 is : "+count);
}
</script>
</body>
</html>