2 9pdf
2 9pdf
BTECH/10111/23
CSE-A
Q1)
import java.util.Scanner;
class Student{
int rollno;
String name;
double percentage;
public Student(){
this.rollno =0;
this.name="";
this.percentage=0.0;
this.rollno= sc.nextInt();
sc.nextLine();
this.name=sc.nextLine();
this.percentage=sc.nextDouble();
for(int i=0;i<4;i++){
students[i].setData();
for(int i=0;i<4;i++){
students[i].printData();
Q2)
import java.util.Scanner;
class Format{
int rollno;
int year;
public Format(){
this.rollno =0;
this.year=0;
this.rollno= sc.nextInt();
sc.nextLine();
this.year=sc.nextInt();
sc.nextLine();
System.out.println("BTECH/"+this.rollno+"/"+this.year);
id.printData();
Q3)
import java.util.Scanner;
class Search{
String str;
String wrd;
this.str=sc.nextLine();
this.wrd=sc.nextLine();
System.out.println(str.contains(wrd));
}
public static void main(String arg[]){
id.stringip();
id.word();
Q4)
import java.util.Scanner;
class Remove{
String str1;
String str2;
this.str1=sc.nextLine();
this.str2=sc.nextLine();
for(int i=0;i<str2.length();i++){
char c=str2.charAt(i);
str1=str1.replace(String.valueOf(c),"");
System.out.println(str1);
id.string1();
id.string2();