0% found this document useful (0 votes)
103 views

Java FRM Tutorial

The document contains code for a Java program that accepts student details like roll number, name, and branch as input. It also accepts exam registration number and marks as input. The program then displays the collected student details and exam details. The code defines classes for student, exam, and main to get input, display output, and run the program respectively.

Uploaded by

Dhanoop Bhaskar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
103 views

Java FRM Tutorial

The document contains code for a Java program that accepts student details like roll number, name, and branch as input. It also accepts exam registration number and marks as input. The program then displays the collected student details and exam details. The code defines classes for student, exam, and main to get input, display output, and run the program respectively.

Uploaded by

Dhanoop Bhaskar
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 28

dhanoopbhaskar@gmail.

com

/* program to add two integers*/

import java.io.*;

class addition

public static void main(String args[])

int num1,num2,sum;

try

DataInputStream x=new DataInputStream(System.in);

num1=Integer.parseInt(x.readLine());

num2=Integer.parseInt(x.readLine());

sum=num1+num2;

System.out.println(“Sum is “+sum);

catch(Exception e)

Page | 1
[email protected]

Page | 2
[email protected]

Page | 3
[email protected]

Page | 4
[email protected]

Page | 5
[email protected]

Page | 6
[email protected]

Page | 7
[email protected]

Page | 8
[email protected]

Page | 9
[email protected]

Page | 10
[email protected]

Page | 11
[email protected]

Page | 12
[email protected]

Page | 13
[email protected]

/*program to accept and print student details*/

import java.io.*;

class student

int rno;

String name,branch;

void get()

try

DataInputStream x=new DataInputStream(System.in);

System.out.println("Enter rollnumber");

rno=Integer.parseInt(x.readLine());

System.out.println("Enter Name");

name=x.readLine();

System.out.println("Enter Branch");

branch=x.readLine();

catch(Exception e)

void display()

{
Page | 14
[email protected]
System.out.println("");

System.out.println("Student Details");

System.out.println("Roll Number: "+rno);

System.out.println("Name: "+name);

System.out.println("Branch: "+branch);

class exam

int regno,mark;

void read()

try

DataInputStream x=new DataInputStream(System.in);

System.out.println("Enter Reg. No");

regno=Integer.parseInt(x.readLine());

System.out.println("Enter mark");

mark=Integer.parseInt(x.readLine());

catch(Exception e)

}
Page | 15
[email protected]
void write()

System.out.println("");

System.out.println("Exam Details");

System.out.println("Reg no: "+regno);

System.out.println("Mark: "+mark);

class main1

public static void main(String args[])

student s=new student();

exam e=new exam();

s.get();

e.read();

s.display();

e.write();

Page | 16
[email protected]

Page | 17
[email protected]

Page | 18
[email protected]

Page | 19
[email protected]

Page | 20
[email protected]

Page | 21
[email protected]

Page | 22
[email protected]

Page | 23
[email protected]

Page | 24
[email protected]

Page | 25
[email protected]

Page | 26
[email protected]

Page | 27
[email protected]

Page | 28

You might also like