Simple Java Program To Calculate Internal Marks of a Student

import java.lang.*;
import java.io.*;
class Internalmarks
{
   public static void main(String args[])   throws IOException
{
int regNo,test1Marks, test2Marks, quizMarks, assMarks, homeAssgnMarks, attPer =0,attMarks = 0;
double weightedAverageTestMarks, totalMarks;
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("enter student id ");
regNo = Integer.parseInt(br.readLine());
System.out.println ("Enter test1 marks");
test1Marks = Integer.parseInt(br.readLine());
System.out.println ("Enter test2 marks");
test2Marks = Integer.parseInt(br.readLine());

if (test1Marks>test2Marks)
weightedAverageTestMarks = (0.75*test1Marks)+(0.25*test2Marks);
else
weightedAverageTestMarks = (0.25*test1Marks)+(0.75*test2Marks);

System.out.println("test marks are:" +weightedAverageTestMarks);
System.out.println("enter quiz marks ");
quizMarks = Integer.parseInt(br.readLine());
System.out.println("enter Assignment Marks ");
assMarks = Integer.parseInt(br.readLine());
System.out.println("enter Home Assignment Marks");
homeAssgnMarks = Integer.parseInt(br.readLine());
System.out.println("enter Attendance Percentage");
attPer = Integer.parseInt(br.readLine());
if (attPer >= 95)
                attMarks = 5;
else if (attPer >= 90)
        attMarks = 4;
else if (attPer >=85)
                attMarks = 3;
else if (attPer >= 80)
                attMarks = 2;
else if (attPer >= 75)
                attMarks = 1;
else if (attPer <75 && attPer>=65)
                System.out.println(" Student is eligible for Exam by paying  Condonation Fee and producing Medical Certificate");               
else

                System.out.println("Student is detained");

totalMarks = weightedAverageTestMarks+quizMarks+homeAssgnMarks+assMarks+attMarks;
System.out.println(" The Internal Marks of the Student = " +totalMarks);
}

}
Bhanu Namikaze

Bhanu Namikaze is an Ethical Hacker, Security Analyst, Blogger, Web Developer and a Mechanical Engineer. He Enjoys writing articles, Blogging, Debugging Errors and Capture the Flags. Enjoy Learning; There is Nothing Like Absolute Defeat - Try and try until you Succeed.

No comments:

Post a Comment