too few arguments while calling functions (c)

Course Queries Syllabus Queries 2 years ago

0 1 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Syllabus Queries related to Course Queries. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (1)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 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.