Professional Documents
Culture Documents
1. Start
2. Create object of BufferedReader class.
3. int a=(Integer.parseInt)br.readLine().
4. float b=(Float.parseFloat)br.readLine();
5. double c=(Double.parseDouble) br.readLine();
6. String d= br.readLine();
7. Display a,b,c,d
8. Create object of Scanner class
9. int p=sc.nextInt()
10. float q=sc.nextFloat()
11. double r=sc.nextDouble()
12. String s=sc.nextLine()
13. Display p,q,r,s
14. Stop
PART B
(PART B : TO BE COMPLETED BY STUDENTS)
(Students must submit the soft copy as per following segments within two hours of the
practical. The soft copy must be uploaded at the end of the practical)
System.out.println();
System.out.println("Roll No.="+rollno);
System.out.println("Name="+name);
System.out.println("Age="+age);
System.out.println("Fees Paid="+feespaid);
System.out.println("Gender="+gender);
System.out.println();
//Scanner Class
Scanner s=new Scanner(System.in);
System.out.print("Enter the Roll No= ");
int a=s.nextInt();
System.out.print("Enter the Name= ");
String b=s.next();
System.out.print("Enter the Age= ");
int c=s.nextInt();
System.out.print("Enter the Fees paid= ");
double d=s.nextDouble();
System.out.print("Gender (M/F)= ");
String e=s.next();
System.out.println();
System.out.println("Roll No.= "+a);
System.out.println("Name= "+b);
System.out.println("Age= "+c);
System.out.println("Fees Paid= "+d);
System.out.println("Gender= "+e);
}
}
B.2 Input and Output:
3. What is casting?
Ans -In Java, type casting is a method or process that converts a data type into another
data type in both ways : manually and automatically. The automatic conversion is done
by the compiler and manual conversion performed by the programmer.
A data structure is a collection of different forms and different types of data that
has a set of specific operations that can be performed. It is a collection of data types. It
is a way of organizing the items in terms of memory, and also the way of accessing each
item through some defined logic.