Absent Calculation

  • Uploaded by: Muhammad Ahsan
  • 0
  • 0
  • April 2020
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Absent Calculation as PDF for free.

More details

  • Words: 265
  • Pages: 2
import java.util.Scanner; /** * * @author Ahs@n */ public class Absent { private int smstrno; private int absents; boolean con; public Absent(){ smstrno=0; absents=0; } public void collecFine(){ } public boolean setSmstrno(int smstrno){ con = (smstrno>0 && smstrno<9)? true:false; if(con){ this.smstrno = smstrno; } return con; } public boolean setAbsents(int absents){ con = (absents<33)? true:false; if(con){ this.absents = absents; } return con; } public void takeInput(){ Scanner input = new Scanner(System.in); do{ System.out.println("To find the total fine \n Please enter the semester no. : "); // int smstrno = input.nextInt(); setSmstrno(smstrno = input.nextInt()); if(!con){ System.out.println("Please re-enter your value"); } }while(!con); do{ System.out.println("\nPlease enter the total no. of bunked lectures : ");

//int absents = input.nextInt(); setAbsents(absents = input.nextInt()); if(!con){ System.out.println("Please re-enter your value"); } }while(!con); collectFine(); } public static void main(String[] args) { new Absent().takeInput(); }

private void collectFine() { if(smstrno == 1){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 2){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 3){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 4){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 5){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 6){ if(absents <3 ){ System.out.println("Your fine } else System.out.println("Your fine } if(smstrno == 7 || smstrno == 8){ if(absents < 3){ System.out.println("Your fine } else System.out.println("Your fine } } }

is 100"); is 500");

is 200"); is 600");

is 300"); is 700");

is 400"); is 800");

is 500"); is 900");

is 600"); is 1000");

is 2000"); is 5000");

Related Documents

Absent Calculation
April 2020 12
Calculation
May 2020 31
Calculation
November 2019 49
Calculation
November 2019 43
Calculation
June 2020 25
Absent Ism
June 2020 8

More Documents from ""