Java Marksheet Using DataInputStream Class
import java.io.DataInputStream;
class Marksheet{
public static void main(String[]args) throws Exception{
DataInputStream ob = new DataInputStream(System.in);
System.out.print("Enter Java Marks ");
String one = ob.readLine();
int java = Integer.parseInt(one);
System.out.print("Enter PHP Marks ");
String second = ob.readLine();
int php = Integer.parseInt(second);
System.out.print("Enter VB.Net Marks ");
String third = ob.readLine();
int vb = Integer.parseInt(third);
System.out.print("Enter C++ Marks ");
String fourth = ob.readLine();
int cpp = Integer.parseInt(fourth);
System.out.print("Enter Assemby Marks ");
String fifth = ob.readLine();
int assembly = Integer.parseInt(fifth);
int total = 500;
int obtained = java + php + vb + cpp + assembly;
int percentage = obtained * 100 / total;
System.out.print(" Total Marks Are : " + total + "\n Your Obtained Marks Are: " + obtained +
"\n Your Percentage is: " + percentage + "%");
}
}
No comments:
Post a Comment