'C Programming: The referenced value passed was not reflecting

I've tried the program below and the value for variable rawGrades was still not reflected. The program was supposed to compute for the raw grades after computing for the specific averages in sequence. What could have been wrong? I executed the program and it did work until the rawGrade or case 5 part and it print 0 regardless of the values passed.

#include <stdio.h>
#include <conio.h>
#include <math.h>
#include <stdlib.h>

int displayMenu();
int process(int choice, float labRepAve, float labActAve, float projAve, float pracExam, float rawGrades);
float calcLabReportAverage();
float calcLabDeliverableAve();
float calcProjAve();
float getPracExamGrade();
float rawGrade(float *labRepAve, float *labActAve, float *projAve, float *pracExam);
float gpe(float rawGrades);

int main() {
    char choice;
    float labRepAve, labActAve, projAve, pracExam, rawGrades;
    
    // call displayMenu() and
    // store the user selection to choice
    choice=displayMenu();        
    if (choice == '1') labRepAve = calcLabReportAverage();
    else if (choice == '2') labActAve = calcLabDeliverableAve();
    else if (choice == '3') projAve = calcProjAve();
    else if (choice == '4') pracExam = getPracExamGrade();
    else if (choice == '5') rawGrades = rawGrade(&labRepAve, &labActAve, &projAve, &pracExam); 
    process(choice, labRepAve, labActAve, projAve, pracExam, rawGrades);
    return 0;
}

int displayMenu() {
    char choice;
    
    // execute the system command cls
    // which clears the screen
    system("cls");

    printf("   Display Menu:  \n");
    printf("1. Lab Report Grades\n");
    printf("2. Lab Activity Deliverables Grades\n");
    printf("3. Project Grades\n");
    printf("4. Practical Exam Grade\n");
    printf("5. Final Raw Score\n");
    printf("6. GPE\n");
    printf("\nOption: \n");
    
    // use getche() from conio.h to get user input.
    // getche() asks for a single key press as
    // a character input
    choice = getche(); 
    if ((choice>='1')&&(choice<='6')) return choice;
    else {
        printf("\n\nIncorrect Menu Entry. Press a key to retry. ");
        getch(); // ask user to press a key to act as pause
        
        // this will cause to displayMenu() to execute itself
        return displayMenu();
    }
}

int process(int choice, float labRepAve, float labActAve, float projAve, float pracExam, float rawGrades) {
    switch (choice) {
        case '1': 
           printf("\nLab Report Grades Average = %f\n",labRepAve);
           system("pause");
           break;
           
        case '2':
           printf("\nLab Activity Deliverables Grades Average = %f\n",labActAve);
           system("pause");
           break;
           
        case '3': 
           printf("\nProject Grades Average = %f\n",projAve);
           system("pause");
           break;
        case '4': 
           printf("\nPractical Exam Grade = %f\n",pracExam);
           system("pause");
           break;
           
        case '5': 
           printf("\nFinal Raw Grade = %f\n",rawGrades);
           system("pause");
           break;
                                     
        case '6':
           gpe(rawGrades);
           system("pause");
           break;   
            
    }
    return main(); 
} 

float calcLabReportAverage() {
    float lr1, lr2, lr3;
    printf("\nEnter 3 Lab Report Grades separated by commas : ");
    scanf("%f,%f,%f",&lr1,&lr2,&lr3);
    return (lr1+lr2+lr3)/3;
}

float calcLabDeliverableAve() {
    float la1, la2, la3;
    printf("\nEnter 3 Lab Activity Deliverable Grades separated by commas : ");
    scanf("%f,%f,%f",&la1,&la2,&la3);
    return (la1+la2+la3)/3;
}

float calcProjAve() {
    float p1, p2;
    printf("\nEnter 2 Project Grades separated by commas : ");
    scanf("%f,%f",&p1,&p2);
    return (p1+p2)/2;
}
float getPracExamGrade() {
    float pe1;
    printf("\nEnter your Practical Exam Grade: ");
    scanf("%f",&pe1);
    return pe1;
}
float rawGrade(float *labRepAve, float *labActAve, float *projAve, float *pracExam){
    float rawGrades;
    rawGrades = (*labRepAve*0.2)+(*labActAve*0.2)+(*projAve*0.15)+(*pracExam*0.3);
    return rawGrades;
}

float gpe(float rawGrades){
    if (rawGrades >= 97) printf("\nGPE = 4.0");
    else if (rawGrades >= 92) printf("\nGPE = 3.5\n");
    else if (rawGrades >= 88) printf("\nGPE = 3.0\n");
    else if (rawGrades >= 82) printf("\nGPE = 2.5\n");
    else if (rawGrades >= 79) printf("\nGPE = 2.0\n");
    else if (rawGrades >= 74) printf("\nGPE = 1.5\n");
    else if (rawGrades >= 70) printf("\nGPE = 1.0\n");
    else printf("\nGPE = 0.0\n");
    return 0;
}


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source