Oopm Experiment 7 46
Oopm Experiment 7 46
INPUT 07 A:
//CLASS: SE CMPNA //
//ROLL NO: 46 //
import java.util.Scanner;
System.out.println("Enter Document:");
int count=0;
for(int i=0;i<arr.length;i++)
if(arr[i].equals("Engineering"))
count++;
if(arr[i].length()>maxword.length())
maxword=arr[i];
newdoc= newdoc.replace(maxword,"*"+maxword+"*");
System.out.println("Modified Document:\n"+newdoc);
OUTPUT:
java -cp /tmp/lO9wWnrGz4 EXP7A
Enter Document:
SFIT has five UG Programs and two PG Programs in the most coveted disciplines considering both
industrial need and public preference. These courses would lead to award of the Degree of Bachelor
of Engineering (B.E.) in Computer Engineering, Electronics & Telecommunication Engineering,
Information Technology, Electrical Engineering and Mechanical Engineering and Master of
Engineering (M.E.) as well as Ph.D. (Technology) in Computer Engineering and Electronics &
Telecommunication Engineering.
SFIT has five UG Programs and two PG Programs in the most coveted disciplines considering both
industrial need and public preference. These courses would lead to award of the Degree of Bachelor
of Engg. (B.E.) in Computer Engg., Electronics & *Telecommunication* Engg., Information
Technology, Electrical Engg. and Mechanical Engg. and Master of Engg. (M.E.) as well as Ph.D.
(Technology) in Computer Engg. and Electronics & *Telecommunication* Engg..
INPUT 07 B:
//NAME:Aarushi Jha//
//ROLL NO:46 //
//CLASS: SE CMPNA//
import java.util.Scanner;
String str=sc.nextLine();
s1.reverse();
if(String.valueOf(s1).compareTo(String.valueOf(s2))==0)
System.out.println(s2+" is Palindrome");
else
{
OUTPUT:
java -cp /tmp/EEIj3ttVCO Exp_7b
malayalam
malayalam is Palindrome
INPUT 07 C:
//CLASS: SE CMPNA //
//ROLL NO: 46 //
import java.util.*;
// Read five names from the command line and add them to the Vector
names.add(name);
Collections.sort(names);
while (enumeration.hasMoreElements()) {
System.out.println(enumeration.nextElement());
}
}
OUTPUT:
java -cp /tmp/0f04aEzY08 StudentNamesSorter
Carol
Jenica
Shruti
Arti
Aarushi