You are on page 1of 4

Programming Paradigms Laboratory

B.Tech.

Name :
Roll Number :
Department : Computer Science and Engineering

Faculty of Engineering & Technology


Ramaiah University of Applied Sciences

Faculty Engineering & Technology


Programme B. Tech. in Computer Science and Engineering
Year/Semester 2nd Year / 4th Semester
Name of the Laboratory Programming Paradigms Laboratory
Laboratory Code 19CSL217A
Laboratory 3
Title of the Laboratory Exercise: One dimensional arrays
1. Questions

a. Develop a Java program to delete the duplicate elements from an array.


b. Develop a GradeBook class with an instance variables string course name and array of grades
that instructors can use to maintain students’ grades on an exam and display a grade report that
includes the grades, class average, lowest grade and highest grade.

2. Calculations/Computations/Algorithms

Code 1:

package removeduplicate;

import java.util.Scanner;

public class RemoveDuplicate {

public static void main(String[] args) {


int len,b,d;
System.out.println("/n Enter size of array.");
Scanner z = new Scanner(System.in);
len= z.nextInt();
int arr[]=new int[len];
d=len;
int c=0,f;
for(int i=0;i<len;i++)
{
System.out.println("/n ENter no.");
b=z.nextInt();
f=0;
for(int j=0;j<len;j++)
{
if(arr[j]==b)
{
f=1;
d--;
}
}
if(f==0)
{

arr[c]=b;
c++;
}
}
for(int i=0;i<d;i++)
{
System.out.println("\n "+arr[i]);
}

3. Presentation of Results

Outpur 1:
4. Conclusions

5. Limitations of Experiments and Results

You might also like