0% found this document useful (0 votes)
14 views5 pages

P2S1 IT-Lab Experiment-7

Uploaded by

callofpro732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views5 pages

P2S1 IT-Lab Experiment-7

Uploaded by

callofpro732
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

Rajiv Gandhi University of Knowledge Technologies-AP, ONGOLE CAMPUS

INFORMATION TECHNLOGY

LAB-7(JAVA SCRIPT)

7.1 Design a simple calculator by using Html, CSS and Javascript?


INSTRUCTIONS:

1. Use the table to create calculator


2. Use the text box to display the numbers and results
3. You may take button element for every number and symbols.
4. You may use following css selectors to get exact above output.

caption{font-size:40px;
color:white;
background-color:tomato;
border:1px solid black;
border-radius:5px;
text-transform:uppercase;}

table { border: 1px solid black;


margin-left: auto;
margin-right: auto;
}

button {
width: 100%;
padding: 20px 40px;
background-color:tomato;
color: white;
font-size: 24px;
font-weight: bold;
border: none;
border-radius: 5px;
}

input[type="text"] {
padding: 20px 30px;
font-size: 24px;
font-weight: bold;
border-radius: 5px;
border: 2px solid black;
}
5. Use the functions for each operations like AC button, backspace button,for entering numbers ,symbols and
= button.

6. You may use eval( ) function for = symbol to calculate the value.
Ex: eval(document.getElementById('res').value)

7. You may use empty string for AC button


Ex: document.getElementById('res').value=""

8. You may use substring method for backspace button.


Ex: document.getElementById("res").value = s.substr(0,s.length-1)

9. You may use function with one argument to entering the numbers and symbols in the result box.
Ex: function show(a)
{
document.getElementById('res').value+=a;
}
7.2 Create a application for calculating the percentage and grades by using Html,Css and JavaScript?
INSTRUCTIONS:
1. You may use table and div tags to create the above output format.
2. You may use following css selectors.
*{font-weight:bold;}
h1{text-decoration:underline;}
div{padding:30px;
position:center;
border:2px solid red;
margin-left:400px;
margin-right:500px;
background-color:lightgreen;
color:tomato;}
table{color:blue;}
button{color:blue;position:center;padding:5px;}

3. After entering obtained marks and total marks, if you click on calculate button, automatically we should get
percentage and grade in their respective fields according to their marks.

4. You may use percentage formula (obtainedmarks/totalmarks)*100

5. You may use switch statement or (else if ladder) to find the grades.

You might also like