Guest User

Untitled

a guest
Dec 11th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. import java.long.*;
  2. im[ort java.io.*;
  3. import java.util.*;
  4. class std
  5. {
  6. String name;
  7. int roll_no,sub1,sub2,total;
  8. float per;
  9. void getadata() throws IOException
  10. {
  11. BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
  12. System.out.println("Enter the name of student");
  13. name=br.readLine();
  14. System.out.println("Enter Rollno of student");
  15. rollno=Integer.parseInt(br.readLine());
  16. System.out.println("Enter marks out of 100 per 1st subject");
  17. sub1=Integer.parseInt(br.readLine());
  18. System.out.println("Enter marks out of 100 per 2nd subject");
  19. sub2= Integer.parseInt(br.readLine());
  20. }
  21. void show()
  22. {
  23. total=sub1+sub2;
  24. per=(total*100)/200;
  25. System.out.println(roll_no+"\n"+name+"\n"+sub1+"\n"+sub2+"\n"total+"\n"+per);
  26. }
  27. }
  28. class student extends std
  29. {
  30. public static void main(String arg[]) throws IOexception
  31. {
  32. student s=new student();
  33. s.getdata();
  34. }
  35. }
Add Comment
Please, Sign In to add comment