def METHOD_NAME(processes, n):
    waitingTime = [0] * n
    turnAroundTime = [0] * n
    totalWaitTime = 0
    totalTurnAroundTime = 0
    calcWaitingTime(processes, n, waitingTime)
    calcTurnAroundTime(processes, n, waitingTime, turnAroundTime)
    # Print results and calculate total turn around time
    print("Processes\tBurst time\tWaiting time\tTurn around time")
    for i in range(n):
        totalWaitTime += waitingTime[i]
        totalTurnAroundTime += turnAroundTime[i]
        print(f"{processes[i].pid}\t\t{processes[i].burstTime}\t\t{waitingTime[i]}\t\t{turnAroundTime[i]}")
    print("\nAverage waiting time =", totalWaitTime / n)
    print("Average turn around time =", totalTurnAroundTime / n)