The Programming Project

Wednesday, December 28, 2022

MEAN CALCULATOR : ICSE AND CBSE ( Assumed and Step-Deviation Method)

 MEAN CALCULATOR : ICSE AND CBSE ( Direct, Assumed and Step-Deviation Method)

Calculation of mean using python programming.

Mean Formula For Grouped Data

There are three methods to find the mean for grouped data, depending on the size of the data. They are:

  • Direct Method
  • Assumed Mean Method
  • Step-deviation Method

Let us go through the formulas in these three methods given below:

Direct Method

Suppose x1, x2, x3,…., xn be n observations with respective frequencies f1, f2, f3,…., fn. This means, the observation x1 occurs f1 times, x2 occurs f2 times, x3 occurs f3 times and so on. Hence, the formula to calculate the mean in the direct method is:

x=f1x1+f2x2+f3x3+.+fnxnf1+f2+f3+.+fn

Or

x=i=1nfixii=1nfi

Here,

∑fixi = Sum of all the observations

∑fi = Sum of frequencies or observations

This method is used when the number of observations is small.

Assumed Mean Method

In this method, we generally assume a value as the mean (namely a). This value is taken for calculating the deviations based on which the formula is defined. Also, the data will be in the form of a frequency distribution table with classes. Thus, the formula to find the mean in assumed mean method is:

Mean, (x)=a+fidifi

Here,

a = assumed mean

fi = frequency of ith class

di = xi – a = deviation of ith class

Σfi = N = Total number of observations

xi = class mark = (upper class limit + lower class limit)/2

Click here to learn more about the assumed mean method in detail.

Step-deviation Method

When the data values are large, the step-deviation method is used to find the mean. The formula is given by:

Mean, (x)=a+hfiuifi

Here,

a = assumed mean

fi = frequency of ith class

xi – a = deviation of ith class

ui = (xi – a)/h

Σfi = N = Total number of observations

xi = class mark = (upper class limit + lower class limit)/2

Run the program on Google Colab 

def parityString(string):
        while len(string) < 9:
            string += " "
        return string
def stepDeviationMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass):
    classWidth = upperLimitOfFirstClass - lowerLimitOfFirstClass
    listLowerClassLimits = []
    listUpperClassLimits = []
    classFrequency = []
    midValue = []
    assumed_Mean = 0
    for i in range(numberOFClasses):
        listLowerClassLimits.append(lowerLimitOfFirstClass)
        listUpperClassLimits.append(upperLimitOfFirstClass)
        print("Enter the frequency of the class:",listLowerClassLimits[i],"-",listUpperClassLimits[i])
        classFrequency.append(float(input()))
        midValue.append((lowerLimitOfFirstClass+upperLimitOfFirstClass)/2.0)
        lowerLimitOfFirstClass += classWidth
        upperLimitOfFirstClass += classWidth
    print("Select the assumed mean (A) from the following values:",midValue)
    assumed_Mean = float(input())
    di = []
    fidi = []
    sum_fi = 0
    sum_fidi = 0
    print(parityString("CLASSES"),parityString("frequency(fi)"),parityString("mid value(xi)"),"   ",parityString("di=(xi-A)/h"),end='')
    print("  ",parityString("fi*di"))
    for i in range(numberOFClasses):
        di.append((midValue[i]-assumed_Mean)/classWidth)
        fidi.append(classFrequency[i]*di[i])
        print(str(listLowerClassLimits[i]),end =' '),
        print("-",parityString(str(listUpperClassLimits[i])),"   ",end='')
        print(parityString(str(classFrequency[i])),"  ",parityString(str(midValue[i])),"  ",parityString(str(di[i])),end = ' ')
        print(parityString(str(fidi[i])))
        sum_fi += classFrequency[i]
        sum_fidi += fidi[i]
    print("--------------------------------------------------------------------------------------------")
    print("Assumed mean A =",assumed_Mean," Class width h = ",classWidth)
    print(parityString("fi="+str(sum_fi)),parityString(" "),"   ",parityString("fidi="+str(sum_fidi)))
    print("CALCULATED MEAN BY SHORT-CUT METHOD:",round(assumed_Mean+(sum_fidi/sum_fi)*classWidth,2))
    print()
def shortCutMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass):
    classWidth = upperLimitOfFirstClass - lowerLimitOfFirstClass
    listLowerClassLimits = []
    listUpperClassLimits = []
    classFrequency = []
    midValue = []
    assumed_Mean = 0
    for i in range(numberOFClasses):
        listLowerClassLimits.append(lowerLimitOfFirstClass)
        listUpperClassLimits.append(upperLimitOfFirstClass)
        print("Enter the frequency of the class:",listLowerClassLimits[i],"-",listUpperClassLimits[i])
        classFrequency.append(float(input()))
        midValue.append((lowerLimitOfFirstClass+upperLimitOfFirstClass)/2.0)
        lowerLimitOfFirstClass += classWidth
        upperLimitOfFirstClass += classWidth
    print("Select the assumed mean (A) from the following values:",midValue)
    assumed_Mean = float(input())
    di = []
    fidi = []
    sum_fi = 0
    sum_fidi = 0
    print(parityString("CLASSES"),parityString("frequency(fi)"),parityString("mid value(xi)"),"   ",parityString("di=xi-A"),end='')
    print(parityString("fi*di"))
    for i in range(numberOFClasses):
        di.append(midValue[i]-assumed_Mean)
        fidi.append(classFrequency[i]*di[i])
        print(str(listLowerClassLimits[i]),end =' '),
        print("-",parityString(str(listUpperClassLimits[i])),"   ",end='')
        print(parityString(str(classFrequency[i])),"  ",parityString(str(midValue[i])),"  ",parityString(str(di[i])),end = ' ')
        print(parityString(str(fidi[i])))
        sum_fi += classFrequency[i]
        sum_fidi += fidi[i]
    print("--------------------------------------------------------------------------------------------")
    print("Assumed mean A =",assumed_Mean)
    print(parityString("fi="+str(sum_fi)),parityString(" "),"   ",parityString("fidi="+str(sum_fidi)))
    print("CALCULATED MEAN BY SHORT-CUT METHOD:",round(assumed_Mean+(sum_fidi/sum_fi),2))
    print()
def directMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass):
    classWidth = upperLimitOfFirstClass - lowerLimitOfFirstClass
    listLowerClassLimits = []
    listUpperClassLimits = []
    classFrequency = []
    midValue = []
    for i in range(numberOFClasses):
        listLowerClassLimits.append(lowerLimitOfFirstClass)
        listUpperClassLimits.append(upperLimitOfFirstClass)
        print("Enter the frequency of the class:",listLowerClassLimits[i],"-",listUpperClassLimits[i])
        classFrequency.append(float(input()))
        midValue.append((lowerLimitOfFirstClass+upperLimitOfFirstClass)/2.0)
        lowerLimitOfFirstClass += classWidth
        upperLimitOfFirstClass += classWidth
    fixi = []
    sum_fi = 0
    sum_fixi = 0
    print(parityString("CLASSES"),parityString("frequency(fi)"),parityString("mid value(xi)"),"   ",parityString("fi*xi"))
    print()
    for i in range(numberOFClasses):
        fixi.append(classFrequency[i]*midValue[i])
        print(str(listLowerClassLimits[i]),end =' '),
        print("-",parityString(str(listUpperClassLimits[i])),"   ",end='')
        print(parityString(str(classFrequency[i])),"  ",parityString(str(midValue[i])),"  ",parityString(str(fixi[i])))
        sum_fi += classFrequency[i]
        sum_fixi += fixi[i]
    print("--------------------------------------------------------------------------------------------")
    print(parityString(" "),parityString("fi="+str(sum_fi)),parityString(" "),"   ",parityString("fixi="+str(sum_fixi)))
    print("CALCULATED MEAN BY DIRECT METHOD:",round(sum_fixi/sum_fi,2))
print("****** MEAN CALCULATION *******")
key = 0
while key != -99:
    print(" WELCOME TO THE MAIN MENU ***** MEAN CALCULATION FOR CONTINUOUS DATA *****")
    print(" Press 1 to CALCULATE MEAN BY DIRECT METHOD: ")
    print(" Press 2 to CALCULATE MEAN BY SHORT CUT METHOD / ASSUMED MEAN METHOD: ")
    print(" Press 3 to CALCULATE MEAN BY STEP DEVIATION METHOD: ")
    print(" Type -99 to exit the menu:")
    key = int(input("Enter your choice:"))
    if key == 1:
        numberOFClasses = int(input("Enter the number of classes:"))
        lowerLimitOfFirstClass = int(input("Enter the lower limit of the first classes:"))
        upperLimitOfFirstClass = int(input("Enter the upper limit of the first classes:"))
        directMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass)
    if key == 2:
        numberOFClasses = int(input("Enter the number of classes:"))
        lowerLimitOfFirstClass = int(input("Enter the lower limit of the first classes:"))
        upperLimitOfFirstClass = int(input("Enter the upper limit of the first classes:"))
        shortCutMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass)
    if key == 3:
        numberOFClasses = int(input("Enter the number of classes:"))
        lowerLimitOfFirstClass = int(input("Enter the lower limit of the first classes:"))
        upperLimitOfFirstClass = int(input("Enter the upper limit of the first classes:"))
        stepDeviationMethod(numberOFClasses,lowerLimitOfFirstClass,upperLimitOfFirstClass)
    if key == -99:
        print("Exited from main menu:")

Saturday, December 24, 2022

Python Project : Result Printing in PDF Project for School or College Students

# ResultPDFPython
Result generation in PDF format using python
The following program is to generate PDF files for all students of a certain class. The PDF files has been generated by Python and the data for the results has been kept in a EXCEL file. There are eight subjects, namely 1. Varnacular 2. English 3. Math 4. Physical Science 5. Life Sciene 6. History 7. Geography and 8. Computer. For a given academic year each student has to give three written exams ( First Summative - 50 marks, Second Summative - 50 marks, Third Summative - 90 marks ) and one project ( 10 marks) for each of the subjects. The marks for the whole academic session will be stored in a Excel file ( see the excel file). 





One has to fetch the marks and print the result individually for each students ( along with their name and roll number). The excel file contains all the data in a pre-defined manner. After the extraction the year total for each subject has to be calculated ( out of 200 ) then the average ( out of 100 ) has also to be displayed. After that the grades has to be calculated based on the following scheme.
  > greater than equal to 90 ----- A+
  > greater than equal to 80 and less than 90 ----- A 
  > greater than equal to 70 and less than 80 ----- B+
  > greater than equal to 60 and less than 70 ----- B
  > greater than equal to 50 and less than 60 ----- C+
  > greater than equal to 25 and less than 50 ----- C
  > less than 25 ------ D
If a student has 3 or more D's out of eight subjects, he/she will be detained otherwise he/she will be promoted.

Note the total marks for the full academic session will be the sum of all the average marks in all subjects ( except Computer) and the percentage will be calculated out of 700.
The format of the result is shown below:                                    





The pdf files along with the excel sheet is present in the repository.
(https://github.com/mathsvinu/ResultPDFPython)

View on Google CodeLabs



import pandas as pd
import openpyxl
from fpdf import FPDF
def grades(averageMarks):
    if averageMarks >= 90:
        return "A+"
    if averageMarks >= 80 and averageMarks < 90:
        return "A"
    if averageMarks >= 70 and averageMarks < 80:
        return "B+"
    if averageMarks >= 60 and averageMarks < 70:
        return "B"
    if averageMarks >= 50 and averageMarks < 60:
        return "C+"
    if averageMarks >= 25 and averageMarks < 50:
        return "C"
    if averageMarks < 25:
        return "D"

# read by default 1st sheet of an excel file
# dataframe1 = pd.read_excel('IX_A_RESULT.xlsx')
# print(dataframe1)
wb = openpyxl.load_workbook('IX_A_RESULT.xlsx')
sh = wb.active
entireMarksList = []
subjectList = ["Bengali","English","Math","PScience","LScience","History","Geography","Computer"]
top = ("Subjects", "First Term", "Second Term", "Annual Written","Project","Annual Total","Grand Total","Average","Grades")
passingGrades =["P","P1","P2","P3","P4","P5","P6","P7","P8"]
for i in range(2,sh.max_row+1):
    for j in range(4,12):
        cellvalue = sh.cell(row=i,column=j)
        entireMarksList.append(cellvalue.value)
#print(entireMarksList)
nametag = 2
for roll in range(0,int((sh.max_row-1)/4)):
    print("Roll Number",roll+1," Name:",sh.cell(row=nametag,column=2).value)

    totalPercentage = 0
    dCounter = 0

    bengaliAnnual = 0
    bengaliTotal = 0
    englishAnnual = 0
    englishTotal = 0
    mathAnnual = 0
    mathTotal = 0
    physcnAnnual = 0
    physcnTotal = 0
    lfscnAnnual = 0
    lfscnTotal = 0
    hisAnnual = 0
    hisTotal = 0
    geoAnnual = 0
    geoTotal = 0
    comAnnual = 0
    comTotal = 0

    bindex = 32*roll
    eindex = 32*roll+1
    mindex = 32*roll+2
    pindex = 32*roll+3
    lindex = 32*roll+4
    hindex = 32*roll+5
    gindex = 32*roll+6
    cindex = 32*roll+7

    subjectAnnualTotal = []
    subjectSessionTotal = []
    firstSummative = []
    secondSummative = []
    thirdSummative = []
    project = []

    # EXTRACTING INDIVIDUAL MARKS FROM THE LIST
    bengaliAnnual += entireMarksList[bindex+2*8]+entireMarksList[bindex+3*8]
    bengaliTotal += bengaliAnnual + entireMarksList[bindex]+entireMarksList[bindex+8]
    subjectAnnualTotal.append(bengaliAnnual)
    subjectSessionTotal.append(bengaliTotal)
    firstSummative.append(entireMarksList[bindex])
    secondSummative.append(entireMarksList[bindex+8])
    thirdSummative.append(entireMarksList[bindex+2*8])
    project.append(entireMarksList[bindex+3*8])

    englishAnnual += entireMarksList[eindex+2*8]+entireMarksList[eindex+3*8]
    englishTotal += englishAnnual + entireMarksList[eindex]+entireMarksList[eindex+8]
    subjectAnnualTotal.append(englishAnnual)
    subjectSessionTotal.append(englishTotal)
    firstSummative.append(entireMarksList[eindex])
    secondSummative.append(entireMarksList[eindex+8])
    thirdSummative.append(entireMarksList[eindex+2*8])
    project.append(entireMarksList[eindex+3*8])

    mathAnnual += entireMarksList[mindex+2*8]+entireMarksList[mindex+3*8]
    mathTotal += mathAnnual + entireMarksList[mindex]+entireMarksList[mindex+8]
    subjectAnnualTotal.append(mathAnnual)
    subjectSessionTotal.append(mathTotal)
    firstSummative.append(entireMarksList[mindex])
    secondSummative.append(entireMarksList[mindex+8])
    thirdSummative.append(entireMarksList[mindex+2*8])
    project.append(entireMarksList[mindex+3*8])

    physcnAnnual += entireMarksList[pindex+2*8]+entireMarksList[pindex+3*8]
    physcnTotal += physcnAnnual + entireMarksList[pindex]+entireMarksList[pindex+8]
    subjectAnnualTotal.append(physcnAnnual)
    subjectSessionTotal.append(physcnTotal)
    firstSummative.append(entireMarksList[pindex])
    secondSummative.append(entireMarksList[pindex+8])
    thirdSummative.append(entireMarksList[pindex+2*8])
    project.append(entireMarksList[pindex+3*8])

    lfscnAnnual += entireMarksList[lindex+2*8]+entireMarksList[lindex+3*8]
    lfscnTotal += lfscnAnnual + entireMarksList[lindex]+entireMarksList[lindex+8]
    subjectAnnualTotal.append(lfscnAnnual)
    subjectSessionTotal.append(lfscnTotal)
    firstSummative.append(entireMarksList[lindex])
    secondSummative.append(entireMarksList[lindex+8])
    thirdSummative.append(entireMarksList[lindex+2*8])
    project.append(entireMarksList[lindex+3*8])

    hisAnnual += entireMarksList[hindex+2*8]+entireMarksList[hindex+3*8]
    hisTotal += hisAnnual + entireMarksList[hindex]+entireMarksList[hindex+8]
    subjectAnnualTotal.append(hisAnnual)
    subjectSessionTotal.append(hisTotal)
    firstSummative.append(entireMarksList[hindex])
    secondSummative.append(entireMarksList[hindex+8])
    thirdSummative.append(entireMarksList[hindex+2*8])
    project.append(entireMarksList[hindex+3*8])

    geoAnnual += entireMarksList[gindex+2*8]+entireMarksList[gindex+3*8]
    geoTotal += geoAnnual + entireMarksList[gindex]+entireMarksList[gindex+8]
    subjectAnnualTotal.append(geoAnnual)
    subjectSessionTotal.append(geoTotal)
    firstSummative.append(entireMarksList[gindex])
    secondSummative.append(entireMarksList[gindex+8])
    thirdSummative.append(entireMarksList[gindex+2*8])
    project.append(entireMarksList[gindex+3*8])

    comAnnual += entireMarksList[cindex+2*8]+entireMarksList[cindex+3*8]
    comTotal += comAnnual + entireMarksList[cindex]+entireMarksList[cindex+8]
    subjectAnnualTotal.append(comAnnual)
    subjectSessionTotal.append(comTotal)
    firstSummative.append(entireMarksList[cindex])
    secondSummative.append(entireMarksList[cindex+8])
    thirdSummative.append(entireMarksList[cindex+2*8])
    project.append(entireMarksList[cindex+3*8])

    # CREATING DATA FOR TABLE PRINTING
    rowOne = []
    rowTwo = []
    rowThree = []
    rowFour = []
    rowFive = []
    rowSix = []
    rowSeven =[]
    rowEight =[]
    for i in range(0,8):
        if i == 0:
            rowOne.append(str(subjectList[i]))
            rowOne.append(str(firstSummative[i]))
            rowOne.append(str(secondSummative[i]))
            rowOne.append(str(thirdSummative[i]))
            rowOne.append(str(project[i]))
            rowOne.append(str(subjectAnnualTotal[i]))
            rowOne.append(str(subjectSessionTotal[i]))
            rowOne.append(str(subjectSessionTotal[i]/2))
            rowOne.append(grades(subjectSessionTotal[i]/2))
        if i == 1:
            rowTwo.append(str(subjectList[i]))
            rowTwo.append(str(firstSummative[i]))
            rowTwo.append(str(secondSummative[i]))
            rowTwo.append(str(thirdSummative[i]))
            rowTwo.append(str(project[i]))
            rowTwo.append(str(subjectAnnualTotal[i]))
            rowTwo.append(str(subjectSessionTotal[i]))
            rowTwo.append(str(subjectSessionTotal[i]/2))
            rowTwo.append(grades(subjectSessionTotal[i]/2))
        if i == 2:
            rowThree.append(str(subjectList[i]))
            rowThree.append(str(firstSummative[i]))
            rowThree.append(str(secondSummative[i]))
            rowThree.append(str(thirdSummative[i]))
            rowThree.append(str(project[i]))
            rowThree.append(str(subjectAnnualTotal[i]))
            rowThree.append(str(subjectSessionTotal[i]))
            rowThree.append(str(subjectSessionTotal[i]/2))
            rowThree.append(grades(subjectSessionTotal[i]/2))
        if i == 3:
            rowFour.append(str(subjectList[i]))
            rowFour.append(str(firstSummative[i]))
            rowFour.append(str(secondSummative[i]))
            rowFour.append(str(thirdSummative[i]))
            rowFour.append(str(project[i]))
            rowFour.append(str(subjectAnnualTotal[i]))
            rowFour.append(str(subjectSessionTotal[i]))
            rowFour.append(str(subjectSessionTotal[i]/2))
            rowFour.append(grades(subjectSessionTotal[i]/2))
        if i == 4:
            rowFive.append(str(subjectList[i]))
            rowFive.append(str(firstSummative[i]))
            rowFive.append(str(secondSummative[i]))
            rowFive.append(str(thirdSummative[i]))
            rowFive.append(str(project[i]))
            rowFive.append(str(subjectAnnualTotal[i]))
            rowFive.append(str(subjectSessionTotal[i]))
            rowFive.append(str(subjectSessionTotal[i]/2))
            rowFive.append(grades(subjectSessionTotal[i]/2))
        if i == 5:
            rowSix.append(str(subjectList[i]))
            rowSix.append(str(firstSummative[i]))
            rowSix.append(str(secondSummative[i]))
            rowSix.append(str(thirdSummative[i]))
            rowSix.append(str(project[i]))
            rowSix.append(str(subjectAnnualTotal[i]))
            rowSix.append(str(subjectSessionTotal[i]))
            rowSix.append(str(subjectSessionTotal[i]/2))
            rowSix.append(grades(subjectSessionTotal[i]/2))
        if i == 6:
            rowSeven.append(str(subjectList[i]))
            rowSeven.append(str(firstSummative[i]))
            rowSeven.append(str(secondSummative[i]))
            rowSeven.append(str(thirdSummative[i]))
            rowSeven.append(str(project[i]))
            rowSeven.append(str(subjectAnnualTotal[i]))
            rowSeven.append(str(subjectSessionTotal[i]))
            rowSeven.append(str(subjectSessionTotal[i]/2))
            rowSeven.append(grades(subjectSessionTotal[i]/2))
        if i == 7:
            rowEight.append(str(subjectList[i]))
            rowEight.append(str(firstSummative[i]))
            rowEight.append(str(secondSummative[i]))
            rowEight.append(str(thirdSummative[i]))
            rowEight.append(str(project[i]))
            rowEight.append(str(subjectAnnualTotal[i]))
            rowEight.append(str(subjectSessionTotal[i]))
            rowEight.append(str(subjectSessionTotal[i]/2))
            rowEight.append(grades(subjectSessionTotal[i]/2))
    # CALCULATING PERCENTAGE AND NUMBER OF D's        
    for l in range(0,7):
        totalPercentage += (subjectSessionTotal[l]/2)
        if grades(subjectSessionTotal[l]/2) == 'D':
            dCounter +=1
    totalMarks = totalPercentage
    totalPercentage /=7
    totalPercentage = round(totalPercentage,2)        
    data = (top,rowOne,rowTwo,rowThree,rowFour,rowFive,rowSix,rowSeven,rowEight)
    # CREATING MARKSHEET
    pdf = FPDF(format='A4')
    pdf.add_page()
    pdf.set_font("helvetica", size = 15)
    pdf.cell(150, 10, txt = "KUMAR ASHUTOSH INSTITUTION (MAIN) BOYS",border=1,align = "C")
    pdf.ln(15)
    pdf.set_font("helvetica", size = 10)
    pdf.set_font(style="I")
    pdf.cell(150, 2, txt = "NAME: "+str(sh.cell(row=nametag,column=2).value) + "                     Roll No." + str(roll+1),align = "C")
    pdf.ln(10)
    pdf.set_font("helvetica", size = 8)
    pdf.cell(150, 2, txt = "ACADEMIC SESSION: 2023",align = "C")
    pdf.set_draw_color(r=0, g=51, b=102)
    pdf.line(x1=10, y1=30, x2=169, y2=30)
    pdf.set_font_size(8)
    pdf.write_html(
        f"""<table border="1"><thead><tr>
        <th width="9%">{data[0][0]}</th>
        <th width="9%">{data[0][1]}</th>
        <th width="10%">{data[0][2]}</th>
        <th width="12%">{data[0][3]}</th>
        <th width="8%">{data[0][4]}</th>
        <th width="10%">{data[0][5]}</th>
        <th width="10%">{data[0][6]}</th>
        <th width="9%">{data[0][7]}</th>
        <th width="7%">{data[0][8]}</th>
        </tr></thead><tbody><tr>
        <td>{'</td><td>'.join(data[1])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[2])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[3])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[4])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[5])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[6])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[7])}</td>
        </tr><tr>
        <td>{'</td><td>'.join(data[8])}</td>
        </tr></tbody></table>""",
        table_line_separators=True,
    )
    """
    for j in range(0,8):
        stringRow = ""
        print(subjectList[j],firstSummative[j],secondSummative[j],thirdSummative[j],project[j],subjectAnnualTotal[j],subjectSessionTotal[j],subjectSessionTotal[j]/2)
        if len(subjectList[j]) < 22:
            for k in range(0, 22-len(subjectList[j])):
                subjectList[j] += " "
        average = subjectSessionTotal[j]/2
        if average < 25.0:
            stringRow += subjectList[j]+" | "+str(firstSummative[j])+" | "+str(secondSummative[j])+" | "+str(thirdSummative[j])+" | "+str(project[j])+" | "+str(subjectAnnualTotal[j])+" | "+str(subjectSessionTotal[j]) + " | "+str(average) + " | "+"D"
        else:
            stringRow += subjectList[j]+" | "+str(firstSummative[j])+" | "+str(secondSummative[j])+" | "+str(thirdSummative[j])+" | "+str(project[j])+" | "+str(subjectAnnualTotal[j])+" | "+str(subjectSessionTotal[j]) + " | "+str(average)
        pdf.cell(200,10, txt = stringRow, ln = 2, align = 'L')
        pdf.cell(200, 10, txt = "-----------------------------------------------------------------------------",ln = 2, align = 'C')
    #end of j-for loop    """
    pdf.ln(4)
    pdf.set_font("helvetica", size = 8)
    pdf.cell(150,2, txt="Attendance ________________                                              Total Marks:"+str(totalMarks)+"    Percentage:"+str(totalPercentage)+"%",align="L")
    pdf.ln(8)
    pdf.cell(150, 2, txt = "Teacher's Signature ________________                                       Signature of HOI ___________________",align = "L")
    pdf.ln(8)
    pdf.cell(150, 2, txt = "Remarks  _________________________________                Guardian's Signature ___________________",align = "L")
    pdf.ln(8)
    pdf.set_font(style="I")
    if dCounter >= 3:
        pdf.cell(150,2,txt="NOT PROMOTED."+ "FAILED IN "+str(dCounter)+" SUBJECTS. ("+str(passingGrades[dCounter])+")",align="L")
    else:
        pdf.cell(150,2,txt="PROMOTED TO CLASS X. ("+str(passingGrades[dCounter])+")",align="L")    
    pdf.output("Roll No.{0}.pdf".format(roll+1))
    nametag +=4
    print() # END OF ROLL - LOOP

Saturday, September 3, 2022

KAIM Co-operative Loan Calculator

 

ENTER THE LOAN AMOUNT:

ENTER THE PRINCIPAL TO BE PAID PER MONTH:

AFTER HOW MANY MONTHS DO YOU WANT TO CLOSE THE LOAN:

THE RATE OF INTEREST is 9% (PER ANNUM):

Sunday, April 3, 2022

GPF - PPF - EPF Calculator

GPF Calculator
Calculator for GPF/PPF. This calculator allows you to calculate the closing balance for a given fiscal year.
Note: Contribution done after 15th of every month will not earn interest for the given month.

Enter the balance of the last FY:

Enter the rate for Q1:

Enter the rate for Q2:

Enter the rate for Q3:

Enter the rate for Q4:

Contribution: April

Contribution: May

Contribution: June

Contribution: July

Contribution: August

Contribution: September

Contribution: October

Contribution: November

Contribution: December

Contribution: January

Contribution: February

Contribution: March

Saturday, April 2, 2022

PPF Calculator - Monthly Basis

PPF Calculator
Public Provident Fund is a long-term investment option that comes with a sovereign guarantee. Not just generally higher than FD returns, the PPF scheme comes power-packed with several benefits for the common man. The interest on PPF deposits is calculated on a monthly basis but credited to the account at the end of the financial year. The interest get added to the principal and one earns interest on the interest for the coming years!
The following calculator allows you to calculate the maturity value for a specified term or for a given financial year. Assuming one is investing a regular amount monthly ( before 5th of each month). Initial investment corresponds to the total amount for the last financial year.

For example, if someone has Rs. 250000 in his/her account for the financial year 2021-22 and he/she wants to contribute Rs. 3000 monthly for the financial year 2022-23 then the total value at the end of FY 2022-23 can be calculated by entering 250000 in the initial investment, 3000 in the monthly investment, 1 as time period and the exisiting rate.

ENTER THE INITIAL INVESTMENT:

ENTER THE MONTHLY INVESTMENT:

ENTER THE TIME PERIOD:

ENTER THE EXPECTED RATE OF INTEREST: