Lab Assignment No 1
Lab Assignment No 1
Lab Task 5 Marks of a student in five different subjects are given as following [90,60,80,50,60]
Write a program to calculate average, and overall grade according to this criteria: Marks Grade.
85% and above A
70% to 84% B
60% to 69% C
50% to 59% D
Below 50% F
Note: use user-defined functions
LAB 2
Lab Task 1 use a simple array to store the marks of 10 students from quiz 1 of data structure
course, the obtained marks are considered out of 15. Write function to compute average marks
for the entire class.
Lab Task 2 Write a program using float ArrayList to store temperature of a week, and write
functions to find week maximum temprature.
Lab Task 3 By using the concept of static linked list, write functions for the following
operations. 1) Insert a value at end of list 2) Remove First value from list 3) Remove last value
from list 4) Display List in Reverse 5) Remove a value from a given index.
LAB 3
Lab Task 1 Find minimum value in a given linked list.
int minimum(node *head)
Lab Task 2 Write a recursive function that finds sum of values of all nodes in a singly linked
list. int sum(Node *head)
Lab Task 3 If two lists are given, write a method which will merge two lists in to a new list. e.g.
list a = {1,3,7,5} list b = {6,10,8,2,4} c = union(a,b) list c = {1,3,7,5, 6,10,8,2,4}
Lab Task 4 If two lists are given, and both contains integer values in ascending order, write a
function which will combine two lists, in a new list, while maintaining the order of values. e.g.
list a = {1,3,5,7} list b = {2,4,6,8,10} list c = {1,2,3,4,5,6,7,8,10} c = merge(a,b)
Lab Task 5 If a lists is given that contains integer values, write a function which will remove all
prime numbers from the list. e.g. list a = {1,2,3,4,5,6,7,8,9,10,11,12,13,14,15} list b =
{2,4,6,8,10} list c = {1,2,3,4,5,6,7,8,10} c = merge(a,b)