Question

This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp, and Main.cpp

1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assigSample UI MAIN MENU |=- 1. Add a student 2. Remove a student 3. change a students grade 4. change group weights 5. Change thCHANGING GRADE - 1. change a homework grade 2. change a quiz grade 3. change an exam grade what type of grade would you likeCHANGING WEIGHTS |=- Enter the weights, separated by spaces, in the order of homework, quizzes, and exams (total must add upGRADEBOOK REPORT Course: COP3014 Quiz average of class: 81.57 % Exam average of class: 77.40 % Final average of class: 79.60

1. The system must be able to manage multiple students (max of 5) and their grades for assignments from three different assignment groups: homework (total of 5), quizzes (total (total of 2) of 4), and exams 2. For each student record, the user should be able to change the grade for any assignment These grades should be accessible to the gradebook for calculations, but not visible or directly mutable outside ofthe student record 3. The gradebook should know the name of the course. It should also know the weights of each assignment group and be able to print a report to the screen. This report should contain the course name and a well-formatted table containing columns for the student names, and for each assignment group. The group weights should be displayed (as a percentage) to the name of each assignment group in the table's header. It should be possible to add and remove students from the gradebook. Removals from the gradebook should shift each successive student "up" gradebook, the remaining students starting with student 4 should be moved up a slot (1e next in the list. For example, if student 3 is removed from the student 4 to student 3's old slot, student 5 to studet 4's old slot, etc.) 4. A user interface should be created with a menu system used to navigate the functionality necessary to complete the stated requirements. It is recommended to use a numbering scheme when prompting the user for their desired action. See the end of this project sheet for a reference you may use for the menus 5. All names (student names, gradebook name) should be set to "" prior to being by the user. This could also be used in logic to determine whether or not a student entry in the gradebook is "valid". Empty student slots should not be displayed in require the user to identify a student record to modify 6. The gradebook should be able to calculate class averages from the student records. The averages are the sum of the valid grades divided by the total number of valid grades for that group (ie. ungraded assignments Since each student record could contain a different number of grades for each category, the class average should be computed assignment group as homework grade (note, not a zero), then their homework average should be comprised of 4 grades instead of 5. When computing the class average homework grade student's average homework grade for the running total, then use that total to compute the average. When computing the average final grade, don't forget 7. See the grading breakdown for additional requirements simple set menus that are not part of the total number of valid grades) as the average of each student's average for each well as their final grade. For example, ifone student if missing a single each use to use the group weights
Sample UI MAIN MENU |=- 1. Add a student 2. Remove a student 3. change a student's grade 4. change group weights 5. Change the gradebook name 6. Display class averages 7. Display ful1 report 0. QUIT Enter an action: 1 -=I ADDING STUDENT Please enter the student's name: Name Here Name Here was successfully added to the gradebook! I ADDING STUDENT - Students cannot be added because the gradebook is full! REMOVING STUDENT - 1. John Doe 2. Jane Doe 3. Third Person Enter student to remove: 1 "John Doe" has been successfully removed! (New class size: 2) REMOVING STUDENT - Cannot remove students because the gradebook is empty!
CHANGING GRADE - 1. change a homework grade 2. change a quiz grade 3. change an exam grade what type of grade would you like to change: 2 1. John Doe 2. Jane Doe 3. Third Person which student's grade would you like to change? 3 CHANGING Third Person's QUIZ GRADE =- 1. 68 2. 3. 97 4. 5. which quiz grade would you like to change: 2 what would you like to change it to (-1 for ungraded): 89 Third Person's quiz grade 2 was changed from to 89!
CHANGING WEIGHTS |=- Enter the weights, separated by spaces, in the order of homework, quizzes, and exams (total must add up to 1.0): 0.15 0.25 0.7 Weights do not add up to 1.0, try again... Enter the weights, separated by spaces, in the order of homework, quizzes, and exams (total must add up to 1.0) 0.15 0.25 0.6 Weights updated Iccessfully! suc |=- CHANGING NAME Please enter the new name for the gradebook: coP3014 Gradebook name changed from "" to "COP3014'" CLASS AVERAGES =- Homework average of class: 85.13% Quiz average of class: 81.57% Exam average of class: 77.40% Final average of class: 79.60%
GRADEBOOK REPORT Course: COP3014 Quiz average of class: 81.57 % Exam average of class: 77.40 % Final average of class: 79.60 % HW AVG Quiz Avg (25 % ) Homework (15 % ) Exams (60 % ) Student Quizzes Exam Avg Final Grade l - --| |--------|----------|---------- |---- --- I I 82 71 87 94 UG John Doe 83.50 .. I... ... .. 87 78 92 UG UG I.. . I... 85.67 I... I... Jane Doe I 83 UG 85 UG UG Third Person 84.00 ... T... I... I... I.. .
0 0
Add a comment Improve this question Transcribed image text
Answer #1

CODE:

#include<iostream>
#include<string.h>
using namespace std;

class gradebook;

class student
{
friend class gradebook;

char name[20]; // std name
int homework_grades[6], quiz_grades[6], exam_grades[4]; //grades array

float homework_avg, quiz_avg, exam_avg, final_avg;
};

class gradebook
{

student list[16];

public:
char gb_name[20]; // gradebook name
int max, total;

// Constructor
gradebook()
{
strcpy(gb_name,"noname");
max = 5;
total = 0;
for(int i=1;i<=15;i++)
{
strcpy(list[i].name,"noname");
for(int j=1;j<=5;j++)
{
list[i].homework_grades[j] = -1;
list[i].quiz_grades[j] = -1;
}
list[i].exam_grades[1] = list[i].exam_grades[2] = list[i].exam_grades[3] = -1;
}
}

// Member functions
void display_std_name();
void display_grades(int, int);
int add_std(char *new_name);
int remove(int);
//int ch_grade(int, int);
};

// Define all functions

// Remove a student from list and adjust remaining
int gradebook::remove(int std_id)
{
if(total==0 || std_id>total || std_id<=0)
return 0;

if(std_id==total)
{
cout<<"\n“"<<list[std_id].name<<"” has been successfully removed! (New class size: 2)";
strcpy(list[total--].name,"noname");
return 1;
}
cout<<"\n“"<<list[std_id].name<<"” has been successfully removed! (New class size: 2)";
for(int i=std_id; i<total; i++)
{
list[i]=list[i+1];
}
total--;
return 1;
}

// Add student to gradebook
int gradebook::add_std(char *new_name)
{
if(total<15)
{
strcpy(list[++total].name, new_name);
return 1;
}
return 0;
}

// Display student name list
void gradebook::display_std_name()
{
for(int i=1;i<=total;i++)
{
cout<<"\n"<<i<<" "<<list[i].name;
}
}

/* Display grades of students
// (grade_id, student_number_in_list)
homework(1), quiz(2), exam(3)
*/
void gradebook::display_grades(int g_id, int std_id)
{
int i;
if(std_id<=total)
{
if(g_id==1)
{
for(i=1;i<6;i++)
{
cout<<"\n"<<i<<". ";
if(list[std_id].homework_grades[i]==-1) cout<<"<ungraded>";
}
}
else if(g_id==2)
{
for(i=1;i<6;i++)
{
cout<<"\n"<<i<<". ";
if(list[std_id].quiz_grades[i]==-1) cout<<"<ungraded>";
}
}
else if(g_id==3)
{
for(i=1;i<4;i++)
{
cout<<"\n"<<i<<". ";
if(list[std_id].exam_grades[i]==-1) cout<<"<ungraded>";
}
}
}
else
cout<<"\nNo such std exists";
}


/***************************** MAIN ***************************/
int main()
{
int main_choice, grade_choice, std_id, new_grade;
char g_name[20], s_name[20];
float a,b,c;
gradebook g;
do
{

cout<<"\n\n-=| MAIN MENU |=-";
cout<<"\n1. Add a student\n2. Remove a student\n3. Change a student’s grade\n4. Change group weights\n5. Change the gradebook name\n6. Display class averages\n7. Display full report\n0. QUIT\n";
cout<<"\nEnter an action: ";
cin>>main_choice;

switch(main_choice)
{

case 0:
break;

case 1:
cout<<"\n-=| ADDING STUDENT |=-";
cout<<"\nPlease enter the student’s name: ";
cin>>s_name;
if(g.add_std(s_name))
cout<<"\n"<<s_name<<" was successfully added to the gradebook!";
else
cout<<"\nStudents cannot be added because the gradebook is full!";
break;

case 2:
cout<<"\n-=| REMOVING STUDENT |=-";
if(g.total!=0)
{
g.display_std_name();
cout<<"\n Enter student to remove: ";
cin>>std_id;
if(!g.remove(std_id))
cout<<"\nCannot remove students";
}
else
cout<<"\nStudents cannot be added because the gradebook is full!";
break;


case 3:
cout<<"\n-=| CHANGING GRADE |=-\n1. Change a homework grade\n2. Change a quiz grade\n3. Change an exam grade";
cout<<"\nWhat type of grade would you like to change: ";
cin>>grade_choice;
g.display_std_name();
cout<<"\nWhich student’s grade would you like to change? ";
cin>>std_id;
//ch_grade(grade_choice, std_id);
g.display_grades(grade_choice, std_id);
break;

/*
case 4:
cout<<"\n-=| CHANGING WEIGHTS |=-";
while(1)
{
cout<<"\nEnter the weights, separated by spaces, in the order of homework, quizzes, and exams (total must add up to 1.0):";
cin>>a>>b>>c;
if(a+b+c==1.00)
break;
else
cout<<"\n Weights do not add up to 1.0, try again...";
}
break;

case 5:
cout<<"\n-=| CHANGING NAME |=-\nPlease enter the new name for the gradebook: ";
cin>>g_name;
cout<<"\n Gradebook name changed from “ ” to "<<g_name;
break;

case 6:
cout<<"\n-=| CLASS AVERAGES |=-";
cout<<"\nHomework average of class: ";
cout<<"\nQuiz average of class: ";
cout<<"\nExam average of class: ";
cout<<"\nFinal average of class: ";
break;

case 7:
break;
*/
default:
cout<<"\n\nInvalid input\n\n";
}

}while(main_choice!=0);

return 0;
}

Add a comment
Know the answer?
Add Answer to:
This is a C++ Program, I need the program broken up into Student.h, Student.cpp, GradeBook.h, GradeBook.cpp,...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • using C# Write a program which calculates student grades for multiple assignments as well as the...

    using C# Write a program which calculates student grades for multiple assignments as well as the per-assignment average. The user should first input the total number of assignments. Then, the user should enter the name of a student as well as a grade for each assignment. After entering the student the user should be asked to enter "Y" if there are more students to enter or "N" if there is not ("N" by default). The user should be able to...

  • Help me write the program in C++ Thanks Program #1: Calculate a student's grade for a...

    Help me write the program in C++ Thanks Program #1: Calculate a student's grade for a class. The class has 4 categories of grades. Each category has different weights. The student's report should include the student's first and last name; course; semester, category listing with weight for each category, grades for each category and the student's final average with a letter grade. Categories with weights: 1. Exams: 30%(3 @ 10% each) 2. Labs: 30% (3 labs @ 10% cach) 3....

  • Language: C++ Write a program that will allow the instructor to enter the student's names, student...

    Language: C++ Write a program that will allow the instructor to enter the student's names, student ID, and their scores on the various exams and projects. A class has a number of students during a semester. Those students take 4 quizzes, one midterm, and one final project. All quizzes weights add up to 40% of the overall grade. The midterm exam is 25% while the final project 35%. The program will issue a report. The report will show individual grades...

  • How could I separate the following code to where I have a gradebook.cpp and gradebook.h file?...

    How could I separate the following code to where I have a gradebook.cpp and gradebook.h file? #include <iostream> #include <stdio.h> #include <string> using namespace std; class Gradebook { public : int homework[5] = {-1, -1, -1, -1, -1}; int quiz[5] = {-1, -1, -1, -1, -1}; int exam[3] = {-1, -1, -1}; string name; int printMenu() { int selection; cout << "-=| MAIN MENU |=-" << endl; cout << "1. Add a student" << endl; cout << "2. Remove a...

  • A students grades and weights are given below, calculate the final grade by calculating a weighted...

    A students grades and weights are given below, calculate the final grade by calculating a weighted average. (Data given in image) Calculate the students final grade: ____% A student's grades and weights are given below. Calculate the final grade by calculating a weighted average. Category Grade Earned Weight of Grade 15% 10% 25% 509% In-class Work61.8% 80.79% 51.7% 56.29% Homework Quizzes Exams 96 Calculate the student's final grade: Round your answer to one decimal place

  • c++ I need help! create Student.h In this class, you are provided with a class skeleton...

    c++ I need help! create Student.h In this class, you are provided with a class skeleton for the Student type. This type should contain two member variables: a string called name a vector of doubles called grades Additionally, you should declare the following functions: A constructor which accepts a single string parameter called name A void function, addGrade which accepts a single double parameter and adds it to the grades vector A function which accepts no parameters and returns the...

  • In this assignment, you will write a program in C++ which uses files and nested loops...

    In this assignment, you will write a program in C++ which uses files and nested loops to create a file from the quiz grades entered by the user, then reads the grades from the file and calculates each student’s average grade and the average quiz grade for the class. Each student takes 6 quizzes (unknown number of students). Use a nested loop to write each student’s quiz grades to a file. Then read the data from the file in order...

  • C++ Write a program to calculate final grade in this class, for the scores given below...

    C++ Write a program to calculate final grade in this class, for the scores given below . Remember to exclude one lowest quiz score out of the 4 while initializing the array. Display final numeric score and letter grade. Use standard include <iostream> Implementation: Use arrays for quizzes, labs, projects and exams. Follow Sample Output for formatting. May use initialization lists for arrays. Weight distribution is as follows: Labs: 15% Projects: 20% Quizzes: 20% Exams: 25% Final Project: 20% Display...

  • Write a program to calculate your final grade in this class. Three(8) assignments have yet to...

    Write a program to calculate your final grade in this class. Three(8) assignments have yet to be graded: Quiz 7, Lab 7 and Final Project. Assume ungraded items receive a grade of 100 points. Remember to drop the lowest two quiz scores. Display final numeric score and letter grade. Implementation: Weight distribution is listed in canvas. Use arrays for quizzes, labs, projects and exams. You are allowed to use initialization lists for arrays. Use at least three (3) programmer defined...

  • In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each gr...

    In C Langage Write a grading program for a class with the following grading policies:- a. There are two quizzes, each graded on the basis of 10 points. b. There is one midterm exam and one final exam, each graded on the basis of 100 points. c. The final exam counts for 50 percent of the grade, the midterm counts for 25 percent and the two quizzes together count for a total of 25 percent. Grading system is as follows:-...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT