Your SlideShare is downloading. ×
0
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Internal mark calculator
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Internal mark calculator

539

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.

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
539
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
21
Comments
4
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. -DIVYA S B.TECH-IT
  • 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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. OUTPUT:
  • 15. I HOPE THIS CODE WILL BE USEFUL FOR YOU  HAVE A GREAT DAY!!!

×