Question 1 [2 marks for each formula, if range is not given inside the formula then zero marks, 5 * 2 = 10 marks]
Suppose following is a work sheet of MS Excel.
Apply the appropriate formulas in MS Excel to find the output of the below mentioned requirements:
- Sum of Marks of all subjects
- Average of all Marks
- Highest Marks attained
- Total number of subjects having Grade A
- Sum of Marks of those subjects having Grade B
Solution:
- = SUM(B6:B15)
- = AVERAGE(B6:B15)
- = MAX(B6:B15)
- = COUNTIF(C6:C15, “A”)
- = SUMIF(C6:C15, “B” , B6:B15)
Question No. 2 : [5 marks for javascript code, if html tags are missing then no deduction of marks]
Write JavaScript code using “For loop” to display all the odd numbers between 1 and 100 (both inclusive). Each number should be displayed on a separate line as follows:
1
3
5
7
9
11
13
.
.
.
.
.
93
95
97
99
100
Solution:
<html>
<body>
<p>The odd numbers between 1 and 100 are</p>
<script type=”text/javascript”>
{
var i;
for (i=1;i<=100;i++)
{
if(i%2==1)
document.write(i + “<br>”);
}
}
</script>
</body>
</html>