Friday , 22 November 2024

CS101 Assignments # 3 Solution Spring 2012

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:

  1. Sum of Marks of all subjects
  2. Average of all Marks
  3. Highest Marks attained
  4. Total number of subjects having Grade A
  5. Sum of Marks of those subjects having Grade B

Solution:

  1. = SUM(B6:B15)
  2. = AVERAGE(B6:B15)
  3. = MAX(B6:B15)
  4. = COUNTIF(C6:C15, “A”)
  5. = 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>

Check Also

CS101 Assignment no 01 fall 2013 solution has been uploaded

Assignment No. 01 Semester: Fall 2013 Introduction to Computing-CS101   Total Marks: Non-Graded   Due …