Saturday, 6 July 2019

Published July 06, 2019 by with 0 comment

MCSL016 June 2016 Set 3 Solved Paper




Question 1- Create a form for online submission of a customer's profile in a restaurant. The profile should include the following fields :
  • Name,Address,Age,Gender - Text Box
  • Room Type (AC, Non-AC, Deluxe) - Select From a Menu
  •  Type of Payment (Cash,Debit Card,Credit Card) - Select from a menu
  • Submit Button
Also do coding of submit button.

solution-

<html>
<head>
<script type="text/javascript">
function validation()
{
if(document.myform.name.value=="")
{
alert('name field is empty');
}
else if(document.myform.address.value=="")
{
alert('Address field is empty');
}
else if (document.myform.age.value=="") {
alert('Age field is empty');
}
else if (document.myform.gender.value=="") {
alert('Gender is necessary');
}
else if(document.myform.roomtype.value=="select"){
                     alert('room type is necessary');
}
else if(document.myform.paymentMode.value=="select"){
                     alert('Please select payment mode');
}
else
{
alert('everything okay');
return true;
}
}
</script>
</head>
<body>
<form name="myform">
Name <input type="text" name="name"><br>
Address <input type="text" name="address"><br>
Age <input type="text" name="age"><br>
Gender <input type="text" name="gender"><br>
Room <select name="roomtype">
<option value="select">Select</option>
<option value="ac">AC</option>
<option value="non-ac">Non-AC</option>
<option value="deluxe">Deluxe</option>
</select><br>
Type of payments <select name="paymentMode">
<option value="select">Select</option>
<option value="debit">Debit Card</option>
<option value="credit">Credit Card</option>
<option value="cash">Cash</option>
</select><br>
<input type="button" value="Submit" onclick="validation()">
</form>
</body>
</html>
Output: 


Question 2- Write a JavaScript / VBScript code to accept the first, middle and last names of users and print them in the order of last, first and middle names.

Solution -
<html>
<head>
<script type="text/javascript">
function changeOrder() {
var names=document.getElementsByTagName('input');
var first_name = names[0].value;
var middle_name = names[1].value;
var last_name = names[2].value;
                document.getElementById('inorder').innerHTML=first_name+" "+middle_name+" "+last_name;
                document.getElementById('changedorder').innerHTML=last_name+" "+first_name+" "+middle_name;
}
</script>
</head>
<body>
         <table cellspacing="10">
          <tr>
          <td>First Name</td>
          <td><input type="text" name="fname"></td>
          </tr>
          <tr>
          <td>Middle Name</td>
          <td><input type="text" name="mname"></td>
          </tr>
          <tr>
          <td>Last Name</td>
          <td><input type="text" name="lname"></td>
          </tr>
          <tr align="center">
          <td colspan="2"><input type="button" value="Change Order" onClick="changeOrder()"></td>
          </tr>
          <tr>
          <td>In Order</td>
          <td id="inorder"></td>
          </tr>
          <tr>
          <td>Changed Order</td>
          <td id="changedorder"></td>
          </tr>
         </table>
</body>
</html>

Output:

if you have any doubt related to this post, you can ask in comment section and if you want solution of any previous year questions. please post that question in section we will try to solve that

Thank You





Read More

Friday, 5 July 2019

Published July 05, 2019 by with 0 comment

MCSL016 June 2015 Set 2 Solution




Question 1 - Design a form for on-line subscription of newspaper having the input fields for users details and e-mail ID. There should be validation checks for null fields and e-mail ID. By clicking the submit button, users will get weekly news at their e-mail ID.

solution -
<html>
<head>
<script type="text/javascript">
function getNews() {
var name = document.myform.name.value;
var age = document.myform.age.value;
var dob = document.myform.dob.value;
var email = document.myform.email.value;
if(name=="")
{
alert('Email is required');
}
else if(age=="")
{
alert('Age is required');
}
else if (dob=="") {
alert('Date of birth field is required');
}
else if (email=="") {
alert('Email is required');
}
else
{
alert('Thankyou for your Subscription, Now you will get weekly news update on you email');
}
}
</script>
</head>
<body>
<form name="myform">
    <h2>NewsPaper Subscription</h2>
Name <input type="text" name="name"><br><br>
Age <input type="text" name="age"><br><br>
dob <input type="date" name="dob"><br><br>
email <input type="text" name="email"><br><br>
<input type="button" name="subscribe" value="subscribe" onclick="getNews()">
</form>
</body>
</html>

Question 2-Design an HTML page having four images aligned in the following format :

solution -
<html>
<head>
<style>
img{
width: 200px;
height: 150px; 
/*because this is a img tag it will be applied to all images in page.  */
}
/*here we are accessing image1 using their id then we have to use # symbol before id*/
#image1
{
margin-left: 40px;
margin-top:40px;
}
#image2
{
margin-left: 700px;
margin-top: 40px;
}
#image3
{
margin-left:450px;
margin-top: 100px;
}
#image4{
margin-left: 1100px;
margin-top: 50px;
}
</style>
</head>
<body>
<img src="C:\Users\user\Desktop\a50.jpg" id="image1">
<img src="C:\Users\user\Desktop\f22.jpg" id="image2">
<img src="C:\Users\user\Desktop\grad.jpg" id="image3">
<img src="C:\Users\user\Desktop\fans.jpg" id="image4">
</body>
</html>

In the "src" property of img tag you have to give the absolute/relative path of your image which you want to display on you web page. Also play with the margin-left, margin-top (means try to change the value of margin-left, margin-top) property of you img to change the position of your image across the webpage.



if you have any doubt related to this post, you can ask in comment section and if you want solution of any previous year questions. please post that question in section we will try to solve that

Thank You




Read More
Published July 05, 2019 by with 0 comment

MCSL016 December 2014 Set 2 Solution




Question 1- Create a log-in page of a water supply company having name and consumer number as password. After clicking log-in button, it should go to a page which should display the water charge bill of the customer of the current month. The bill should have the following fields :• Name and address • Period• Consumption of water in kilolitres • Amount

Solution -
This question is very similiar to Question 1 of MCSL016 December 2016 Set 1. You have to change the some field and do the same javascript function calling to solve this question.

Question 2 - Create a page with frames as shown below :

 Solution - 
<html>
<head></head>
<frameset cols="*,*,*,*,3*" border="3" >
<frame></frame>
<frame></frame>
<frame></frame>
<frame></frame>
<frameset rows="*,*,*">
<frame></frame>
<frame></frame>
<frame></frame>
</frameset>

</frameset>
</html>

here we have user * that means it will automatically calculate the width of frame, if you want to set the width of frame manually that you can use col="18%,18%,18%,18%,28%"




if you have any doubt related to this post, you can ask in comment section and if you want solution of any previous year questions. please post that question in section we will try to solve that

Thank You




Read More

Thursday, 4 July 2019

Published July 04, 2019 by with 0 comment

MCSL-016 December 2014 Set 1 Solved Paper




Question 1- Create a form for on-line payment of telephone bill which should have the following fields :
  • Name and Address
  • Telephone Number
  • Consumer Number
  • Pay by date
  • Amount Payable
  • Surcharge amount payable after due date
Run Validation check on each Field.

solution-

main.html

<html>
<head>
<title>Telephone online payment</title>
<script type="text/javascript">
function checkValidation()
    {
    var name = document.payform.name.value;
    var address = document.payform.address.value;
    var telephoneno = document.payform.telnumber.value;
    var consumerno = document.payform.consnumber.value;
    var paybydate = document.payform.pbdate.value;
    var amtpay = document.payform.amtpayable.value;
    var suramt = document.payform.suramt.value;
    if(name=="")
    {
    alert('name is required');
    return false;
    }
    else if(address=="")
    {
    alert('address is required');
    return false;
    }
    else if(telephoneno=="")
    {
    alert('Telephone number is required');
    return false;
    }
    else if(consumerno=="")
    {
    alert('Consumer Number is required');
    return false;
    }
    else if(paybydate=="")
    {
    alert('Pay by date is required');
    return false;
    }
    else if(amtpay=="")
    {
    alert('Payable Amount is required');
    return false;
    }
    else if(suramt=="")
    {
    alert('Surcharge amount can be empty');
    return false;
    }
    else
    {

    }
    // here we are saving variable locally so that we can access it through another page
    localStorage.setItem('name',name);
    localStorage.setItem('address',address);
    localStorage.setItem('telephoneno',telephoneno);
    localStorage.setItem('consumerno',consumerno);
    localStorage.setItem('paybydate',paybydate);
    localStorage.setItem('amtpay',amtpay);
    localStorage.setItem('suramt',suramt);
                return true;
    }
</script>
</head>
<body>
<form name="payform">
<table background-color="red">
<tr>
<td>Name</td>
<td><input type="text" name="name"></td>
</tr>
<tr>
<td>Address</td>
<td><input type="text" name="address"></td>
</tr>
<tr>
<td>Telephone Number</td>
<td><input type="text" name="telnumber"></td>
</tr>
<tr>
<td>Consumer Number</td>
<td><input type="text" name="consnumber"></td>
</tr>
<tr>
<td>Pay by date</td>
<td><input type="date" name="pbdate"></td>
</tr>
<tr>
<td>Amount Payable</td>
<td><input type="text" name="amtpayable"></td>
</tr>
<tr>
<td>Surcharge amount payable after due date</td>
<td><input type="text" name="suramt"></td>
</tr>
<tr>
<td colspan="2" align="center"><input type="button" value="Proceed" onClick="checkValidation()"></td>
</tr>
</table>
</form>
</body>
</html>


Question 2 - Create a log-in page of any telephone company having field names : name of the customer and telephone number as password. It should have validation checks on both fields. After checking a log-in button, it should display the telephone bill of the current month of the customer having fields as shown in Question 1. 

solution-

main.html

<html>
<head>
<title>Login Page</title>
<script type="text/javascript">
function checkUser()
{
var username = document.loginform.cusname.value;
var password = document.loginform.telnumber.value;

if(username == "surajchauhan66" && password =="12345")
{
window.location.href = "billpage.html";
    return true;
}
else
{
                   alert('incorrect username or password');
                   return false;
               }
}
</script>
</head>
<body>
<form name="loginform">
<table>
<tr>
<td>Customer Name</td>
<td><input type="text" name="cusname"></td>
</tr>
<tr>
<td>Telephone number</td>
<td><input type="text" name="telnumber"></td>
</tr>
<tr>
<td><input type="button" value="Login" onClick="checkUser()"></td>
</tr>
</table>
</form>
</body>
</html>


BillDetail.html-

<html>
<head>
<title>Bill Detail page</title>
<script type="text/javascript">
function load()
{
document.getElementById('nameid').innerHTML = localStorage.getItem('name');
document.getElementById('addressid').innerHTML = localStorage.getItem('address');
document.getElementById('telnumberid').innerHTML = localStorage.getItem('telephoneno');
document.getElementById('consnumberid').innerHTML = localStorage.getItem('consumerno');
document.getElementById('pbdateid').innerHTML = localStorage.getItem('paybydate');
document.getElementById('amtpayid').innerHTML = localStorage.getItem('amtpay');
document.getElementById('suramtid').innerHTML = localStorage.getItem('suramt');

    }
</script>
</head>
<body onLoad="load()">
<table>
<tr><td><h1>Bill Detail</h1></td></tr>
<tr>
<td><b>Name:</b></td><td id="nameid"></td>
</tr>
<tr>
<td><b>Address:</b></td><td id="addressid"></td>
</tr>
<tr>
<td><b>Telephone Number:</b></td><td id="telnumberid"></td>
</tr>
<tr>
<td><b>Consumber Number:</b></td><td id="consnumberid"></td>
</tr>
<tr>
<td><b>Pay By Date:</b></td><td id="pbdateid"></td>
</tr>
<tr>
<td><b>Amount Payable:</b></td><td id="amtpayid"></td>
</tr>
<tr>
<td><b>Surcharge Amount:</b></td><td id="suramtid"></td>
</tr>
</table>
</body>
</html>


if you have any doubt related to this post, you can ask in comment section and if you want solution of any previous year questions. please post that question in section we will try to solve that

Thank You







Read More
Published July 04, 2019 by with 0 comment

MCSL-016 December 2016 Set 3 Solutions




Question 1- Create an HTML Page to generate the following table to show your academic history and do validation check on null fields:


   Name                  Examination board/University               Year of passing                  Pass Percentage
1.Secondary
2.Higher
3.Graduation
solution - 
<html>
<head>
<script type="text/javascript">
function validate()
{
var table = document.getElementById("mytable1");
var row = document.getElementById("mytable1").rows.length;
var col = 4;
var i,j;
for(i=1;i<row;i++)
{
for(j=1;j<col;j++)
{
if(table.rows[i].cells[j].innerHTML=="")
{
alert('Please enter the '+table.rows[0].cells[j].innerHTML+' for '+table.rows[i].cells[0].innerHTML);

}
}
}
return true;
}
</script>
</head>
<body >
<table border="1" cellspacing="0" id="mytable1">
<tr><td>Name</td>
<td>Examination Board/University</td>
<td>Year of Passing</td>
<td>Pass Percentage</td>
</tr>
<tr>
<td>Secondary</td>
<td>Up board</td>
<td>2013</td>
<td>85.5%</td>
</tr>
<tr>
<td>Higher Secondary</td>
<td>Up borad</td>
<td></td>
<td>2015</td>
</tr>
<tr>
<td>Graduation</td>
<td>Ignou</td>
<td>2020</td>
<td></td>
</tr>
</table>
<input type="button" value="click" onclick="validate()">
</body>

</html>

Question 2 - Write a program in javascript to find the position of the first occurance of a text in a string.
solution-
<html>
<head>
<script type="text/javascript">
function findpos() {
var str = document.getElementById('para').innerHTML;
var txt = document.getElementById('text').value;
                var position = str.toLowerCase().indexOf(txt.toLowerCase());
                if(position >=0)
                document.getElementById('posnum').value=position;
                else
                {
                document.getElementById('posnum').value ="this txt does not exist";
                }
}
</script>
</head>
<body>
<p id="para" style="font-size:23px">recovery team at Mumbai Airport is putting all its efforts to pull SpiceJet flight out of the grassy area. Air bags have been laid below the belly of the aircraft.The flight SpiceJet overshot runway at Mumbai Airport on Monday. </p>

<h3>Enter the text whose first occurance postion you want to find</h3>
<input type="text" name="txt" id="text">
<input type="button" value="click" onclick="findpos()"><br> <br>
<b>Position number of given text is</b><br><input type="text" id="posnum">
</body>

</html>








if you have any doubt related to this post, you can ask in comment section and if you want solution of any previous year questions. please post that question in section we will try to solve that

Thank You




Read More