too few arguments while calling functions (c)

Course Queries Syllabus Queries 3 years ago

7.51K 1 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago

 

I'm still ridiculously new to this, but I think I've got this code coming along nicely. This program sizes up some hardcoded-in grades and converts them to letter form according to my classes syllabus. In the gradePrint function, the strcopy_s functions all give the "too few arguments while calling functions" error.

Here is the code:

#include
#include 
#include b.h>

int grade(name,attendance, assignments, programs, quizzes, exam) // this takes the int values from the main function
{
    int attendancePercent, assignmentsPercent, programsPercent, quizzesPercent, examPercent; // makes the percentage values
    int finalGrade;

    attendancePercent = attendance * 5 / 100;
    assignmentsPercent = assignments * 20 / 100;
    programsPercent = programs * 30 / 100;
    quizzesPercent = quizzes * 25 / 100;
    examPercent = exam * 20 / 100;
    finalGrade = (attendancePercent + assignmentsPercent + programsPercent + quizzesPercent + examPercent +2);
    finalGrade = gradePrint(name, finalGrade); // this sends the finalGrade and the name over to gradePrint

}





int gradePrint(name, finalGrade) {

    char letter[100];


    if (finalGrade > 105 || finalGrade < 0) { printf("%d is not a valid grade.\n", finalGrade); }
    if (finalGrade <= 105 && finalGrade >= 97) { strcpy_s(letter, "A+"); }
    if (finalGrade <= 96 && finalGrade >= 94) { strcpy_s(letter, "A"); }
    if (finalGrade <= 93 && finalGrade >= 90) { strcpy_s(letter, "A-"); }
    if (finalGrade <= 89 && finalGrade >= 87) { strcpy_s(letter, "B+"); }
    if (finalGrade <= 86 && finalGrade >= 84) { strcpy_s(letter, "B"); }
    if (finalGrade <= 83 &&
                                                
0 views
0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum