-DIVYA S
B.TECH-IT
JAVA
 INTERNAL MARK CALCULATOR FOR ANNA VARSITY STUDENTS 

 /**








* @author DIVYA S
* @java version 1.1
* ...
JAVA
 public double attendanceCalculation(double











attendedPeriods,
double totalPeriods) {
attendance = ...
JAVA















} else if (attendance > 85 && attendance <= 90) {
avgAttendance = 3;
return avgAttendanc...
JAVA














public double markCalculation(double mark) {
avg = (mark / 100) * 5;
avgMark = Math.round(a...
JAVA

 public class InternalMarkCalculator {
 public static void main(String args[]) {
 Scanner s = new Scanner(System...
JAVA

 do {
 System.out
 .println("ENTER THE STUDENT NAME (without any








intial or space): ");
studentName...
JAVA
 System.out.println("ENTER THE SUBJECT: ");
 subject = s.next();
 System.out.println("ENTER THE SUBJECT CODE: ");
...
JAVA

 System.out
 .println("ENTER THE NUMBER OF PERIODS THAT










STUDENT ATTENDED (in numerical): ");
at...
JAVA














if (unit1Mark < 0 || unit1Mark > 100)
System.err.println("YOU HAVE ENTERED WRONG INPUT!!!")...
JAVA















attendance = im
.attendanceCalculation(attendedPeriods, totalPeriods);
System.out.printl...
JAVA

 System.out.println("THE STUDENT AVERAGE MODEL










MARK IS (out of 5): "
+ avgModelMark);
System.out...
JAVA

 System.out.println("");
 System.out.println("IF YOU WANT TO CONTINUE PRESS 5, ELSE

0!!!");
 again = s.nextInt()...
OUTPUT:
I HOPE THIS CODE
WILL BE USEFUL
FOR YOU 

HAVE A GREAT DAY!!!
Upcoming SlideShare
Loading in …5
×

Internal mark calculator

1,161 views

Published on

This is a file, which contains java code for Internal mark calculator. I hope this will be very useful for many students and those college affialated to anna univ.

Published in: Technology, News & Politics
4 Comments
1 Like
Statistics
Notes
No Downloads
Views
Total views
1,161
On SlideShare
0
From Embeds
0
Number of Embeds
7
Actions
Shares
0
Downloads
27
Comments
4
Likes
1
Embeds 0
No embeds

No notes for slide

Internal mark calculator

  1. 1. -DIVYA S B.TECH-IT
  2. 2. JAVA  INTERNAL MARK CALCULATOR FOR ANNA VARSITY STUDENTS    /**       * @author DIVYA S * @java version 1.1 * @SRI RAMANUJAR ENGINEERING COLLEGE * @INFORMATION TECHNOLOGY */ import java.util.Scanner;   /**         * * * JAVA PROGRAM FOR INTERNAL MARK CALCULATOR * * */ class InternalMark { double attendance, avg, avgMark, internalmark, avgAttendance;
  3. 3. JAVA  public double attendanceCalculation(double         attendedPeriods, double totalPeriods) { attendance = (attendedPeriods / totalPeriods) * 100; if (attendance >= 75 && attendance <= 80) { avgAttendance = 1; return avgAttendance; } else if (attendance > 80 && attendance <= 85) { avgAttendance = 2; return avgAttendance;
  4. 4. JAVA               } else if (attendance > 85 && attendance <= 90) { avgAttendance = 3; return avgAttendance; } else if (attendance > 90 && attendance <= 95) { avgAttendance = 4; return avgAttendance; } else if (attendance > 95 && attendance <= 100) { avgAttendance = 5; return avgAttendance; } else { avgAttendance = 0; return avgAttendance; } }
  5. 5. JAVA             public double markCalculation(double mark) { avg = (mark / 100) * 5; avgMark = Math.round(avg); return avgMark; } public double Internal(double attendance, double avgUnit1Mark, double avgUnit2Mark, double avgModelMark) { internalmark = (attendance + avgUnit1Mark + avgUnit2Mark + avgModelMark); return internalmark; } }
  6. 6. JAVA   public class InternalMarkCalculator {  public static void main(String args[]) {  Scanner s = new Scanner(System.in);  InternalMark im = new InternalMark();  int again;  double unit1Mark, unit2Mark, modelMark, avgUnit1Mark, avgUnit2Mark, avgModelMark, attendance, totalPeriods, attendedPeriods, intm;  String studentName, studentRegNo, studentDept, studentSem, subject, subjectCode;
  7. 7. JAVA  do {  System.out  .println("ENTER THE STUDENT NAME (without any        intial or space): "); studentName = s.next(); System.out.println("ENTER THE STUDENT REGISTER NUMBER: "); studentRegNo = s.next(); System.out.println("ENTER THE STUDENT DEPARTMENT: "); studentDept = s.next(); System.out.println("ENTER THE STUDENT SEMESTER: "); studentSem = s.next();
  8. 8. JAVA  System.out.println("ENTER THE SUBJECT: ");  subject = s.next();  System.out.println("ENTER THE SUBJECT CODE: ");  subjectCode = s.next();  System.out.println("ENTER THE TOTAL PERIODS (in numerical): ");  totalPeriods = s.nextDouble();  if (totalPeriods <= 0 || totalPeriods > 100)  System.err.println("YOU HAVE ENTERED WRONG INPUT!!!");
  9. 9. JAVA  System.out  .println("ENTER THE NUMBER OF PERIODS THAT          STUDENT ATTENDED (in numerical): "); attendedPeriods = s.nextDouble(); if (attendedPeriods < 0 || attendedPeriods > 100) System.err.println("YOU HAVE ENTERED WRONG INPUT!!!"); if (attendedPeriods > totalPeriods) System.err .println("THE ATTENDED PERIODS MUST BE LESSER THAN TOTAL PERIODS!!!"); System.out .println("ENTER THE STUDENT's UNIT TEST-I MARK (in numerical): "); unit1Mark = s.nextDouble();
  10. 10. JAVA             if (unit1Mark < 0 || unit1Mark > 100) System.err.println("YOU HAVE ENTERED WRONG INPUT!!!"); System.out .println("ENTER THE STUDENT's UNIT TEST-II MARK (in numerical): "); unit2Mark = s.nextDouble(); if (unit2Mark < 0 || unit2Mark > 100) System.err.println("YOU HAVE ENTERED WRONG INPUT!!!"); System.out .println("ENTER THE STUDENT's MODEL EXAM MARK (in numerical): "); modelMark = s.nextDouble(); if (modelMark < 0 || modelMark > 100) System.err.println("YOU HAVE ENTERED WRONG INPUT!!!");
  11. 11. JAVA               attendance = im .attendanceCalculation(attendedPeriods, totalPeriods); System.out.println(""); System.out.println("THE STUDENT AVERAGE ATTENDANCE IS (out of 5): " + attendance); avgUnit1Mark = im.markCalculation(unit1Mark); System.out .println("THE STUDENT AVERAGE UNIT-I MARK IS (out of 5): " + avgUnit1Mark); avgUnit2Mark = im.markCalculation(unit2Mark); System.out .println("THE STUDENT AVERAGE UNIT-II MARK IS (out of 5): " + avgUnit2Mark); avgModelMark = im.markCalculation(modelMark);
  12. 12. JAVA  System.out.println("THE STUDENT AVERAGE MODEL          MARK IS (out of 5): " + avgModelMark); System.out.println(""); intm = im.Internal(attendance, avgUnit1Mark, avgUnit2Mark, avgModelMark); if (intm < 0 || intm > 20) System.err.println("WRONG INTERNAL MARK!!!"); else System.out.println("THE STUDENT INTERNAL MARK IS (out of 20): " + intm);
  13. 13. JAVA  System.out.println("");  System.out.println("IF YOU WANT TO CONTINUE PRESS 5, ELSE 0!!!");  again = s.nextInt();  System.out.println("");  } while (again == 5);            if (again == 0) { System.out.println("YOU'VE BEEN EXITED!!!"); System.exit(again); } else System.err.println("WRONG INPUT!!!"); } }
  14. 14. OUTPUT:
  15. 15. I HOPE THIS CODE WILL BE USEFUL FOR YOU  HAVE A GREAT DAY!!!

×