LEASE ANSWER IN C++ Begin by writing a Student class. The public section has the following methods: Student::Student() Constructor. Initializes all data elements: name to empty string(s), numeric variables to 0. bool Student::ReadData(istream& in) Data input. The istream should already be open. Reads the following data, in this order: • First name (a string, 1 word) • Last name (also a string, also 1 word) • 5 quiz scores (integers, range 0-20) • 3 exam scores (integers, range 0-100) Assumes that all data is separated by whitespace. The method returns true if reading all data was successful, otherwise returns false. Does not need to validate or range-check data; if one of the quiz or exam scores is out of range, just keep going.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PLEASE ANSWER IN C++

Begin by writing a Student class. The public section has the following methods:
Student::Student()
Constructor. Initializes all data elements: name to empty string(s), numeric variables to 0.
bool Student::ReadData(istream& in)
Data input. The istream should already be open. Reads the following data, in this order:
• First name (a string, 1 word)
• Last name (also a string, also 1 word)
• 5 quiz scores (integers, range 0-20)
• 3 exam scores (integers, range 0-100)
Assumes that all data is separated by whitespace. The method returns true if reading all data was
successful, otherwise returns false. Does not need to validate or range-check data; if one of the quiz or
exam scores is out of range, just keep going.
bool Student::WriteData(ostream& out) const
Output function. Writes data in the following format. Each student’s data is on one line.
• First name (left justified, 20 characters)
• Last name (left justified, 20 characters)
• 5 quiz scores (each right justified in a field 4 characters wide)
• 3 exam scores (each right justified in a field 5 characters wide)
• new-line character ‘\n’ or use of endl in output function
Note that this is a const method; it should not modify any of the object’s data. Returns true if the
attempt to send the data to the stream was successful, false otherwise.
string Student::GetFirstName() const;
string Student::GetLastName() const;
Accessor methods, also known as ‘getters.’ Returns data from inside the function.
float Student::CourseAverage() const
Returns the student’s weighted average as a percentage (float in range 0-100). The quiz scores are
averaged together (20-point scale) and are 35% of the course grade. The exams are averaged together
and are 65% of the course grade. This does not modify any of the object’s data.
bool Student::DisplayCourseAverage(ostream& out) const
Prints the student’s course average to the provided output stream, rounded to 3 decimal places. Returns
true if the attempt was successful, false otherwise.
string Student::LetterGrade() const
Returns a string with the student’s letter grade, using the same grading scale as this course.
The class should assume that any input or output streams passed to public methods are already open.
The main program is quite simple. You are provided a data file with data for some number of students.
Read the data into a vector. (Hint: Declare one student. Read that student’s data, then add it to the
vector. Repeat.) It should then print a roster, showing the name, course average to 3 decimal places, and
letter grade for each student in the course. This list should be sorted by student name (sort by last name,
break ties using first name; display in usual first-name last-name order).

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education