Menu

[solved]-Assignment Similar First Project Assignment Please Write Program Provides Way Search Displ Q39087944

This assignment is similar to the first project. In thisassignment, please write a program that provides a way for you tosearch and display information of all students in the class.Student records including c# and scores of multiple categories aresaved in the file point.dat. Your program should: • First,read all student information from the text file and store them inan array of Student objects. • Calculate total score and finalletter grade. The total score is the sum of CLA, OLA,Quiz, Homework, Exam and Bonus. There will be five letter grades,A(>=90), B(>=80), C(>=70), D(>=60), and F(<60). Theletter grade is determined based on the total score. For example,if the term grade is 79, then the letter grade is C, and if theterm grade is 89, then the letter grade is B. • Prompt userto input a valid c#, and the program display all information of thestudent with the given c#, including the total score and finalletter grade. • Then display information of all students, includingtotal score and final letter grade. You can proceed as follows: •Design and implement the class Student, which represents ID, scoreinformation of a student. You will store instances of this class inthe Roster class. • Design and implement the class Roster, whichrepresents class roster and provides approaches to manage theroster. Skeleton header files for Student and Roster areprovided. In skeleton files, all member data and some functions aredefined. However, predefined functions may be not enough.Additional functions may be required to accomplish the task.Assignment Objectives: This assignment provides experience in thenew programming paradigm — object-oriented programming. In otherwords, you need to design classes with an appropriate interface(i.e. the
set of public functions), and make them work together to accomplishthe specified task.

Requirements 1) You are required to use C++ classes for thisprogram. You should have a “Student” class, and a “Roster” class.Header files for these classes are provided by the instructor. Itis not necessary to modify the provided header files.
2) Output for this program must clearly and neatly show that theprogram does work and that it works correctly.   
3) The files you need to submit are: Student.h, Student.cpp,Roster.h, Roster.cpp, and ola2.cpp.

DATA FILE:

ID CLA OLA Quiz Homework Exam Bonus Total FinalGrade  
c088801 10 15 4 15 56 5
c088802 9 12 2 11 46 2
c088803 8 10 3 12 50 1
c088804 5 5 3 10 53 3
c088805 3 11 1 10 45 0
c088806 8 14 2 11 40 -1
c088807 4 12 2 12 48 -2
c088808 10 10 3 11 36 0
c088809 8 8 3 11 39 0
c088810 6 9 4 9 47 3
c088811 8 7 3 13 41 3
c088812 4 11 3 11 37 1
c088813 9 15 2 8 50 2
c088814 8 12 2 10 48 4
c088815 6 8 1 7 45 1
c088816 7 7 2 6 51 2
c088817 8 9 2 12 38 2

The Roster.h

#ifndef__CSCI3110_ROSTER__
#define __CSCI3110_ROSTER__

#include
#include
#include “Student.h”

class Roster
{
   public:

      // constructor, the parameter is the coursename
       // Create an empty roster, i.e.m_studentNum = 0 for
       // a specific course
       Roster(std::string courseName);

      // This function reads student information froma file
       // The parameter is a filename
       // post-condition:
       //      m_students contains student information read from the file
       //      m_studentNum is the number of students read from thefile  
       void readStudentRecord( std::string);

     //*****************************************
       //Add your functions here ifnecessary
      //*****************************************

  private:
       static const int  MAX_NUM = 25;   // The maximum # of students of aclass
                                        // Class constant. Allobjects share the same copy
       std::string          m_courseName;   //THe name of the course
       int                 m_studentNum;   // Actual Student #
       Student             m_students[MAX_NUM]; // The array of student objects

};

#endif

The Student.h

#ifndef__CSCI3110_STUDENT__
#define __CSCI3110_STUDENT__

#include
#include

class Student
{
   public:
       // The types of score. You canaccess the type or enumerators outside
       // of the Student class scope bythe following expressions:
       //   Student::ScoreTypeStudent::CLA Student::BONUS
       enum ScoreType {CLA, OLA, QUIZ,HOMEWORK, EXAM, BONUS};

      // To access the class constant outside of theStudent class scope:
       //  Student::CATEGORY_NUM
       static const int CATEGORY_NUM =BONUS – CLA + 1;

      // default constructor. This is necessary sincewe define an array
       // of students in the classRoster
       Student( void );

      //Accessor & mutator of m_id
       std::string getID( void )const;
       void setID( std::string ) ;

  
       //Accessor and mutator ofm_score
       //ScoreType indicates which scoreyou want to access
       void changeScore( const ScoreType,const int );
       int getScore( const ScoreType )const;

//********************************************************************
       //Add your functions here ifnecessary
//like getters and setters for m_total and m_letterGrade
      //********************************************************************

  private:
       std::string      m_id;       // StudentID
       int              m_score[CATEGORY_NUM];
                      //m_score[CLA] is CLA score      
                      //m_score[OLA] is OLA score      
                      //m_score[QUIZ] is QUIZ score      
                      //m_score[HOMEWORK] is HOMEWORK score     
                      //m_score[EXAM] is EXAM score      
                      //m_score[BONUS] is BONUS score
int m_total; //total score, which is the sum of all scores
   char m_letterGrade;
};
#endif

Expert Answer


Answer to This assignment is similar to the first project. In this assignment, please write a program that provides a way for you … . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *