Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can anyone help me with this in C language? For this project you will implement a gradebook application that allow us to keep track of

Can anyone help me with this in C language?

For this project you will implement a gradebook application that allow us to keep track of scores for a particular course. The gradebook keeps track of students, assignments and scores students have obtained in those assignments. The actual operations your application must support are described below.

For this project you must provide a gradebook.h file and a gradebook.c file. The gradebook.h file will have the structure definitions and prototypes associated with the project. The following are constants you must define and use in your project:

#define MAX_NAME_LEN 50

#define MAX_EMAIL_LEN 80

#define MAX_NUMBER_OF_STUDENTS 200

#define MAX_NUMBER_OF_ASSIGNMENTS 100

The following structures are to be defined and used for this project. You may not add any additional fields to the structures nor any other structures. The above constants and the structures must be defined in the gradebook.h file.

Student - It has two string fields (name and email).

Gradebook - It defines the following fields:

1.number of assignments - Integer value

2.assignment names - Two-dimensional array of characters with MAX NUMBER OF ASSIGNMENTS rows and MAX NAME LEN + 1 columns

3.number of students - Integer value

4.students - Array of Student structures with a maximum size of MAX NUMBER OF STUDENTS

5.scores - Two-dimensional array of integers with MAX NUMBER OF STUDENTS rows and MAX NUMBER OF ASSIGNMENTS columns

The following functions must be defined for this project and must appear in the gradebook.c file. The prototypes for these functions must appear in the gradebook.h file. Feel free to add additional functions you feel can help you, but do not include them in gradebook.h. These additional/auxiliary functions will appear in gradebook.c and must be defined as static (just add static before the function return type). You can use these auxiliary functions to avoid code duplication.

init gradebook - Takes a parameter a Gradebook pointer. It performed any necessary steps required to initialize the gradebook. It returns 1 on success and 0 otherwise.

add student - Takes a Gradebook pointer, a string (name) and a string (email) as parameters. It adds the specified student to the gradebook if the student is not part of the gradebook. Students are uniquely identified by name. The function will fail if either the name, email or both are NULL. The function returns 1 if the student is added and 0 otherwise.

print gradebook - Takes a Gradebook pointer and an integer as parameters. Displays students and scores information. Scores information will be displayed if the second parameter is different than o. See the public tests output for information regarding the output format. The function returns 1 on success and 0 otherwise.

add assignment - Takes a Gradebook pointer and a string as parameters. It adds that assignment to the gradebook if it does not already exist. All assignments have a maximum value of 100. The function returns 1 on success and 0 otherwise.

set assignment score - Takes a Gradebook pointer, a string (students name), a string (assignments name) and a score. The function will initialize the score the student obtained for this assignment to the specified value. The function returns 1 on success and 0 otherwise.

get avg and letter grade - Takes a Gradebook pointer, a string (students name), an integer pointer (average), and a character pointer (letter grade). The function will return the students average in the class and the students letter grade. Letter grades will be computed using the standard curve cutoffs (A(90), B(80), C(70), D(60), F. Notice that we use integer operations to compute the average (not floating point). The function returns 1 on success and 0 otherwise.

get stats - Takes a Gradebook pointer, a string (assignments name), an integer pointer (minimum value), an integer pointer (maximum value), and an integer pointer (average value). The function computes the minimum, maximum and average values associated with the specified assignment. The function returns 1 on success and 0 otherwise.

For all the above functions, a function will failed (returning 0) if the Gradebook pointer parameter is NULL. If that is the case, before returning 0, the function must print the message Invalid gradebook on a line by itself.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database System

Authors: Elmasri Ramez And Navathe Shamkant

7th Edition

978-9332582705

More Books

Students also viewed these Databases questions

Question

88 Environmental scanning concepts and applications.

Answered: 1 week ago

Question

Provide examples of Dimensional Tables.

Answered: 1 week ago