Want help , been struggling with this :(

A college offers diploma course with five set modules each. Define a class Student
as an ADT that uses separate files for the interface and the implementation. This class
represents a record of one student’s registration and results. For each Student the
following information should be kept as member variables:
the student’s name, ID, student number, the name of the diploma, average mark, an
array with the five module codes for the diploma, and another array with five results -
one for each of the modules.
Class Student should also have a member function calcAverage() to calculate
the average for the five results and a member function pass() to determine whether
or not a student has passed the module. A student only passes a diploma course if he
or she has obtained more than 50% for all the modules, regardless of his or her
average mark. Member function pass()should return a boolean value.
Add a member function displayResults() to display a student’s results after the
examinations. Member function displayResults() display a student’s name,
student number, name of the diploma registered for, his or her results for each module,
the average mark and whether he or she passed or failed the diploma.
In addition, the class should contain a default constructor that initializes all the member
variables with string values to empty strings and all the member variables with numeric
values to 0. The destructor should print a message “Bye!”.
Include accessor and mutator functions that returns / sets the value of the member
variables for the student’s name, ID, student number, the name of the diploma, and
average mark. The mutator that sets the diploma name, also sets the module names
for the diploma automatically. At the moment the college only offers two diplomas,
Garden Design and Gourmet Cooking. Garden Designs students take modules G1,
G2, G3, G4 and G5, while Gourmet Cooking students take modules C1, C2, C3, C4
and C5. Add an accessor function to return the name of one module and a mutator
function to set the value of one exam result.
Overload the stream insertion << (implemented as a friend function) so that it can
be used to output an object of class Student containing values for all the member
variables of class Student to a file.
Demonstrate the class in an application program (main()) to test your class that does
the following:
Initialise an array of three objects of class Student with the following values:
Name John Martin Busi Molefe Sean Naidoo
ID 78120189 81011201 69812018
Student
number
12345 23456 34567
Diploma Garden Design Gourmet Cooking Garden Design
Display one Student record at a time (name, ID, student number and course) and
capture the exam results for each module for the student from the keyboard. Calculate
the average mark for the student. Once a student’s results have been captured, output
the record to a file RegisteredStudentsResults. Once all the results for all the
students have been captured, use the member function displayResults() to
display the results for each student.
Use the following input data to test your class (each column represents the five results
for the five modules the student in the first row of that column took):
John Martin Busi Molefe Sean Naidoo
55 69 69
65 71 45
59 66 66
68 59 57
60 63 50

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
 #include <iostream>

using namespace std;

class student
{
    public:
            string studentName;
            int studentID;
            int studentNum;
            string diplomaName;
            double avgMark;


    private:

};



i want to know if what i did so far is correct? im new in coding so please bare with me. I want to ask so now how do I add member variables? and do I write normal operators with averages to be obtained etc? Any assistance would be greatly appreciated.
To add member variables, just declare them the same way you have studentName, studentID etc.

You're missing some members for the student record:
the student’s name, ID, student number, the name of the diploma, average mark, an array with the five module codes for the diploma, and another array with five results -
one for each of the modules.


The calcAverage member function might be declared like this (inside class student):
double calcAverage();

Then in your student.cpp file, you define the code for that function like this:
1
2
3
4
double student::calcAverage()
{
    // Insert the code to compute the average here
}

the student’s name, ID, student number, the name of the diploma, average mark, an array with the five module codes for the diploma, and another array with five results - one for each of the modules.


As a starter for the Student class definition, consider:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <string>

class Student {
public:
	Student() {}
	~Student();
	string getName() const;
	void setName(std::string& nam);

private:
	static const size_t NoMod {5};

	string studentName;
	unsigned studentID {};
	unsigned studentNum {};
	string diplomaName;
	double avgMark {};
	string modules[NoMod] {};
	int results[NoMod] {};
};


You'll need to provide the implementations in the separate file as required. You don't need a default constructor implementation as the variables are initialised when defined.
please bare with me

Hold yer horses, buddy! This is not that kind of place!

Assignment starts at bottom of page 43 here:
https://docplayer.net/184815135-Important-information.html
Topic archived. No new replies allowed.