Hi guys, i am new in the forum and i need your help for this exercise:
(I thing i am on the rigth side.Sorry if it is too long ).
To create the class student with the following private data:
• the number of the student (int) (from 1 to 9999)
• The name of the student (char *) (up to 40 characters)
• The number of courses has given (int) (from 1 to 8)
• The score for each subject (float *) (from 1.0 to 10.0)
• Ti aggregate score (average) collected (float)
• The number of courses passed and those who cut (int)
• The minimum and maximum points (float)
As members of the pubic student, define the following:
• The functions for initialization and import prices in each of the four first data class (data problem). To place the necessary control data entry and if given invalid values, functions to set some defaults (default) (eg set "No_name" for the name, and zero values for all other cases).
• The functions to initialize, calculate and award values to other data class (request the problem).
• The function to print the total data of the student.
• The constructor initializes which will make and set appropriate values in the data class and the corresponding destructor.
The function main () will define objects of class and then use the print function to display the results as shown in the example below (the initial prices will be given by the main () and not the user):
Name: James Statbk
Id: 1510
Subjects Given: 5
Grades taken: 7.0, 3.0, 6.0, 10.0, 4.0
Passed in 3 Subjects, Failed in 2 Subjects
Average Grade: 6
Minimum Grade: 3.0
Maximum Grade: 10.0
code:
#include<iostream>
using namespace std;
class student{
private:
int ID;//identity
char *NAME;//name
int SUB;// subjects
float *GR_PER;//grade per subject
float AV;//average
int PS;//passed subjects
int FS;//failed subjects
float MAX;// max grade
float MIN;//min grade
public:
student(int sub,float gr_per)//here is a problem
{
void student::set_PS_FS()
{ int ps=0;
int fs=0;
for(int i=0;i<get_SUB();i++)
{ float *grades=get_GR_PER();//can i do that
if(grades[i]>=5)
{
ps++;
}
}
PS=ps;}