Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

NEED help with the student.h and student.cpp for this project the main.cpp file is done do not need to change it What the main does

NEED help with the student.h and student.cpp for this project the main.cpp file is done do not need to change it What the main does is passes all the tests it asks for so for the output it should say passed.. this program is in c++.

image text in transcribed

image text in transcribed

// Student.h

#pragma once #include

using namespace std;

class Student { public: Student(); // default constructor Student(const string &cwid); // constructor with parameter void addCourseGrade(const string &courseName, char grade); // add course name and grade to student's record double getGPA(); // calculate and return GPA void printTranscript(); // print transcript - see Student.cpp for the format string getCWID(); // return the CWID of this student private: // any private member variables and methods go here // TO BE COMPLETED

}; ==================================================================================================================== //student.cpp

#include "Student.h"

#include

Student::Student() { // TO BE COMPLETED

}

Student::Student(const string &cwid) { // TO BE COMPLETED

}

string Student::getCWID() { // TO BE COMPLETED }

void Student::addCourseGrade(const string &courseName, char grade) { // TO BE COMPLETED

}

double Student::getGPA() { // TO BE COMPLETED

}

// print transcript in this (sample) format: // TRANSCRIPT FOR CWID=279750343 // CS 121 C // CS 253 B // CS 131 B // GPA = 2.6667 void Student::printTranscript() { // TO BE COMPLETED

}

====================================================================================================== //main.cpp

////////////////////////////////////////////////////////////////////////////////////////////// // DO NOT EDIT THIS FILE (except for your own testing) // CODE WILL BE GRADED USING A MAIN FUNCTION SIMILAR TO THIS //////////////////////////////////////////////////////////////////////////////////////////////

#include #include #include #include

#include "Student.h"

using namespace std;

template bool testAnswer(const string &nameOfTest, const T &received, const T &expected);

template bool testAnswerEpsilon(const string &nameOfTest, const T &received, const T &expected);

int main() { { // test only the Student class Student student("123456789"); testAnswer("Student::getCWID test", student.getCWID(), string("123456789")); student.addCourseGrade("cs101", 'A'); testAnswerEpsilon("Student::getGPA test1", student.getGPA(), 4.0); student.addCourseGrade("cs201", 'C'); testAnswerEpsilon("Student::getGPA test2", student.getGPA(), 3.0); }

}

template bool testAnswer(const string &nameOfTest, const T &received, const T &expected) { if (received == expected) { cout

template bool testAnswerEpsilon(const string &nameOfTest, const T &received, const T &expected) { const double epsilon = 0.0001; if ((received - expected

Obiective The grades of all students are in a text file in the following format: CS121 CS121 CS121 CS121 CS253 CS253 CS253 CS131 CS131 CS131 267893043 A 454454651 B 279750343 C 546208080 C 454454651 B 279750343 B 546208080 656529993 D 546208080 B 279750343 B where column 1 is the course name, Column 2 is the student's CWID, and column 3 is the grade You are given partial implementations of two classes. Class student stores the course information for one student his/her list of courses and grades in each. A method in this class can then calculate the GPA. A Registrar object stores multiple students' information. It reads a text file (formatted as above) and populates objects of class Student each time a line is read You are to complete the implementations of these two classes, adding public/private member variables and functions as needed. Your code is tested in the provided main.cpp. Initially, the given code does not even compile. As you complete the code, it should pass the tests in the main. Obiective The grades of all students are in a text file in the following format: CS121 CS121 CS121 CS121 CS253 CS253 CS253 CS131 CS131 CS131 267893043 A 454454651 B 279750343 C 546208080 C 454454651 B 279750343 B 546208080 656529993 D 546208080 B 279750343 B where column 1 is the course name, Column 2 is the student's CWID, and column 3 is the grade You are given partial implementations of two classes. Class student stores the course information for one student his/her list of courses and grades in each. A method in this class can then calculate the GPA. A Registrar object stores multiple students' information. It reads a text file (formatted as above) and populates objects of class Student each time a line is read You are to complete the implementations of these two classes, adding public/private member variables and functions as needed. Your code is tested in the provided main.cpp. Initially, the given code does not even compile. As you complete the code, it should pass the tests in the main

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Modeling And Design

Authors: Toby J. Teorey, Sam S. Lightstone, Tom Nadeau, H.V. Jagadish

5th Edition

0123820200, 978-0123820204

More Books

Students also viewed these Databases questions