+1443 776-2705 panelessays@gmail.com

Are you looking for Reliable Online Writing Services? We are Here For you. Our Professional Tutors Can Handle Any Kind of Assignment. Don’t Use Plagiarized Sources. Get Your Perfect Paper Today! Click Here To Order.

QuestionAnswered step-by-stepICT283 Assessed exercise1 Topic 3: 1.Use Registration.zip from the…ICT283 Assessed exercise 1Topic 3:1. Use Registration.zip from the previous exercise. Rename the Course class to Unit as it will be used to represent a unit at Murdoch. Modify the class so that it has unit name, unit id and credits. Section name is not used. The output operators use the new attributes to display. Provide appropriate set and get methods for the class. Create a data file with unit information relevant to Murdoch units. Modify the main program so that the new data file is used with the correct unit information. Test your program to make sure it works as before.2. Create a new class call Result. Result will contain unit and the marks (one floating point number) obtained for that unit. Provide appropriate set and get methods for the class. Think about how the class will be used. The registration class will be modified to have a list of Results instead of a list of Courses. Registration.zipMain.cpp// MAIN.CPP – Case Study, Student Registration// Count the number of courses taken by the student, calculate total credits// author KRI//#include #include #include “course.h” // Course class declaration#include “regist.h” // Registration class declarationusing namespace std;// Main program:// Open an input file stream, read a Registration object,// including its list of courses. Redisplay all information,// and calculate the total credits taken. Write the results// to a file stream.int main(){ ifstream infile( “rinput.txt” ); if( !infile ) return -1; Registration R; infile >> R; ofstream ofile( “routput.txt” );// Use a debugger and track down the calls made “behind the scene” ofile << R  << "Number of courses = " << R.GetCount() << 'n'  << "Total credits   = " << R.GetCredits() << 'n'; // Declare and initialize a Course, and modify // its credits. Course aCourse( "MTH_3020", 'B', 2 ); aCourse.SetCredits( 5 ); cout << aCourse << endl; // the operator << for Course is called return 0;}Course.cpp// COURSE.CPP - Course class implementation#include "course.h"Course::Course(){ name[0] = ''; // it is a char * string, not a C++ string object.}Course::Course( const char * nam, char sect,        unsigned cred ){ strncpy( name, nam, CourseNameSize ); section = sect; credits = cred;}istream & operator >>( istream & input, Course & C ){ input >> C.name >> C.section >> C.credits; return input;}ostream & operator <<( ostream & os, const Course & C ){ os << " Course: " << C.name << 'n'   << " Section: " << C.section << 'n'   << " Credits: " << C.credits << 'n'; return os;}Course.h// COURSE.H - Course class definition// author KRI// modified smr#ifndef COURSE_H#define COURSE_H#include #include  // C string libraryusing namespace std;const unsigned CourseNameSize = 10;class Course {public: Course(); Course( const char * nam, char sect, unsigned cred ); // Construct a course from a name, section letter, // and number of credits. unsigned GetCredits() const; // Get the number of credits. void SetCredits( unsigned cred ); // Set the number of credits. // These operators have been made friends. They have // privileged access to class internals. // Very useful for debugging the class, but not very good for class design. // We will keep using it for now but you will have a chance in a later lab // to redesign this class. friend ostream & operator <<( ostream & os, const Course & C ); friend istream & operator >>( istream & input, Course & C );private: char name[CourseNameSize]; // course name, C style string. not a C++ string object char section;  // section (letter) can be enrolment mode int credits;  // number of credits};inline unsigned Course::GetCredits() const{ return credits;}inline void Course::SetCredits( unsigned cred ){ credits = cred;}#endifRegist.h// REGIST.H – Registration class definition// author KRI// modified smr#ifndef REGIST_H#define REGIST_H#include #include “course.h”using namespace std;const unsigned MaxCourses = 10;class Registration {public: Registration(); unsigned GetCredits() const; unsigned GetCount() const; // These operators have been made friends. They have // privileged access to class internals. // Very useful for debugging the class, but not very good for class design. // We will keep using it for now but you will have a chance in a later lab // to redesign this class. friend ostream & operator <<( ostream & os,     const Registration & R); friend istream & operator >>( istream & input,     Registration & R );private: long studentId;       // student ID number unsigned semester;     // semester year, number unsigned count;       // number of courses Course courses[MaxCourses]; // array of courses};inline unsigned Registration::GetCount() const{ return count;}#endifRegist.cpp// REGIST.CPP – Registration class implementation.#include “regist.h”Registration::Registration(){ count = 0;}unsigned Registration::GetCredits() const{ unsigned sum = 0; for(unsigned i = 0; i < count; i++)  sum += courses[i].GetCredits(); return sum;}istream & operator >>( istream & input, Registration & R ){ input >> R.studentId >> R.semester >> R.count; for(unsigned i = 0; i < R.count; i++)  input >> R.courses[i]; // track down which >> operator is called. Hint: look at what is being input. return input;}ostream & operator <<( ostream & os, const Registration & R ){ os << "Student ID: " << R.studentId << 'n'   << "Semester:  " << R.semester << 'n'; for(unsigned i = 0; i < R.count; i++)  os << R.courses[i] << 'n'; return os;}MAIN TASK: This is an assessed exercise. Sub-tasks 5 and 6 are the specific ones being assessed and these tasks also incorporate all prior changes needed, so do not skip anything.ExerciseMake sure you document all class specification code (i.e. in .h files) using doxygen style comments. Class implementation code and main program code (i.e. in .cpp files) will have normal comments. Do not put doxygen comments in implementation .cpp files.1. Modify the previous topic's practical exercise (topic 3) so that every class has the full complement of set and get methods. Unit test each class to ensure that the set, get and other methods work. You will need to follow this approach for all classes that you create/modify from now onwards - all classes must have a full complement of set and get methods; are fully unit tested before being used in an application.2. Move the body of methods into the corresponding implementation files (.cpp). Only class declarations and method declarations are in .h files. This is the approach that you will use for all future work except when you are working with template classes (template classes will be covered later). Run the unit tests to make sure all changes are working.3. Modify exercise 2 (above) so that instead of using C style strings, the string class from #include is used (std::string). See lecture notes Lec-08.ppt and Lec-09.ppt for differences between the C style string and std::string types. You are changing over from the C string to the Object Oriented string std::string.In the previous lab exercise, the unit name had “_” between words to simplify the reading of the unit name from the data file. Normally, names like “Data Structures And Abstractions” have spaces between the words. You may want to restructure the data file to reflect this but this might create problem if you try to read in a std::string using the “>>” operator as only one word is read in each time. One way around this is to have the unit name on a line by itself in the data file and use the getline(…)to read the entire line, composed of a number of words into one std::string object. Alternatively, you may want to read the unit name in with the “_” between words and replace the “_” with a space character when storing the values in your data structure. A better way is to have the data related to one record on one line separated by a delimiter (usually a comma) and use the getline(…) with the delimiter parameter to read the data in (see lecture notes for topic 3, Lec-09.ppt, first and then more details if necessary at http://en.cppreference.com/w/cpp/string/basic_string/getline). For now, use any approach that you like, but you will have to eventually (very soon) use the comma delimiter in CSV files as CSV files are needed for the assignment. Web search “csv format”.4. You need to draw a UML diagram to see the relationships between the classes before attempting any code change.Create new class call Date. Date will contain the date stored as day of the month, month and the year. Provide appropriate set and get methods for the class. Think about how the class will be used. Modify the input data file to cater for dates. The date in the data file refers to when the mark for the unit was obtained. Unit test the date class. The outputoperator for Result should output the unit information, the marks and the date these marks were obtained. The output for registration in the output data file will contain the Student ID, Semester, unit information, date and marks for each unit. The output should be in a similar format as the output in the previous exercise except it will have the date information as well and there will be no “_” in the unit name. A sample run is shown at the end.5. *Once the above exercises are completed (includes testing everything), convert all I/O operators (operator<< and operator>>) so that they are no longer friends (see Lec-12.ppt for why) and they are not methods of the class. You will need to make use of the set and get methods from exercise 1 above. Run the unit tests to make sure all changes are working. This modification should not affect the main program (client program that makes use of the classes). A sample run is shown at the end.6. *Run doxygen and examine the output to see that your initial UML design matches the design as shown in doxygen.                   Sample Run:Student ID: 12345678Semester: 1 Unit ID: ICT283 Unit Name: Data Structures and Abstractions Credits: 3 Marks: 90 Date: 30 June 2016 Unit ID: ICT289 Unit Name: Computer Graphics Credits: 3 Marks: 97 Date: 30 December 2016Number of Units = 2Total Credits = 6Engineering & TechnologyComputer ScienceICT 283Share Question