Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.long.*;
- im[ort java.io.*;
- import java.util.*;
- class std
- {
- String name;
- int roll_no,sub1,sub2,total;
- float per;
- void getadata() throws IOException
- {
- BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
- System.out.println("Enter the name of student");
- name=br.readLine();
- System.out.println("Enter Rollno of student");
- rollno=Integer.parseInt(br.readLine());
- System.out.println("Enter marks out of 100 per 1st subject");
- sub1=Integer.parseInt(br.readLine());
- System.out.println("Enter marks out of 100 per 2nd subject");
- sub2= Integer.parseInt(br.readLine());
- }
- void show()
- {
- total=sub1+sub2;
- per=(total*100)/200;
- System.out.println(roll_no+"\n"+name+"\n"+sub1+"\n"+sub2+"\n"total+"\n"+per);
- }
- }
- class student extends std
- {
- public static void main(String arg[]) throws IOexception
- {
- student s=new student();
- s.getdata();
- }
- }
Add Comment
Please, Sign In to add comment