Please write C++ functions, class and methods to answer the following questions. 1. Define a new C++ class named “Exam” that manages simple exam information: student id (integer) and a score (integer) The class must provide at least the following two methods: • isPassing which will return a boolean: true if the score is >=60 and false otherwise • toString method that returns the string containing all the information about the Exam including the status of pass or fail. It is considered to have “Passed” status when the score is >= 60 and “Failed” otherwise. For example, here is the output for different Exam objects: ID(1234) SCORE(100) STATUS(Passed) ID(1235) SCORE(50) STATUS(Failed) • isDuplicate method that compares the student id between the two Exam objects and return true if they both have the same student id number, and false otherwise. Note: you can add as many other methods as you need. Show how this class, objects and its methods are being used and tested. 2. Write a function named “report” that accepts an array of Exam objects and its array size. It will go through the given list of Exam objects and return the number of exams that have “Passed” status, the minimum and maximum scores as well as the pointer to the Exam object that has the maximum score (just one object if there are multiple objects with the same max score). In another words, this function will return 4 different values. You can assume that the given array has at least one Exam. - 2 - 3. Write a function named isThisStudentPassing that accepts an array of Exam object pointers, its size and the search student id. It will go through the given array of pointers to find all the exams belong to that search student id. It will return true if that student has all the exams with “Passed” status and false otherwise. In another words, the student must pass all exams to return true. If one of them failed, it will return false. In addition, this function returns the number of exams belonged to that student.
Please write C++ functions, class and methods to answer the following questions. 1. Define a new C++ class named “Exam” that manages simple exam information: student id (integer) and a score (integer) The class must provide at least the following two methods: • isPassing which will return a boolean: true if the score is >=60 and false otherwise • toString method that returns the string containing all the information about the Exam including the status of pass or fail. It is considered to have “Passed” status when the score is >= 60 and “Failed” otherwise. For example, here is the output for different Exam objects: ID(1234) SCORE(100) STATUS(Passed) ID(1235) SCORE(50) STATUS(Failed) • isDuplicate method that compares the student id between the two Exam objects and return true if they both have the same student id number, and false otherwise. Note: you can add as many other methods as you need. Show how this class, objects and its methods are being used and tested. 2. Write a function named “report” that accepts an array of Exam objects and its array size. It will go through the given list of Exam objects and return the number of exams that have “Passed” status, the minimum and maximum scores as well as the pointer to the Exam object that has the maximum score (just one object if there are multiple objects with the same max score). In another words, this function will return 4 different values. You can assume that the given array has at least one Exam. - 2 - 3. Write a function named isThisStudentPassing that accepts an array of Exam object pointers, its size and the search student id. It will go through the given array of pointers to find all the exams belong to that search student id. It will return true if that student has all the exams with “Passed” status and false otherwise. In another words, the student must pass all exams to return true. If one of them failed, it will return false. In addition, this function returns the number of exams belonged to that student.
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
Related questions
Question
ll data members must be declared as private.
Global variables are not allowed. Constants are ok.
There should be no usage of cin or cout in the method or in the class definition or
required functions. They should be handled using parameters and return values.
cin and cout can and should be used in the testing functions.
There should be only one “return” statement in a function or method. Multiple return
statements within the same function/method are not allowed.
Please pay attention to the required data types in the description.
tuple, list andvector classes are not allowed to be used in this exam.
Please write C++ functions, class and methods to answer the following questions.
1. Define a new C++ class named “Exam” that manages simple exam information:
student id (integer) and a score (integer)
The class must provide at least the following two methods:
• isPassing which will return a boolean: true if the score is >=60 and false
otherwise
• toString method that returns the string containing all the information about
the Exam including the status of pass or fail. It is considered to have “Passed”
status when the score is >= 60 and “Failed” otherwise.
For example, here is the output for different Exam objects:
ID(1234) SCORE(100) STATUS(Passed)
ID(1235) SCORE(50) STATUS(Failed)
• isDuplicate method that compares the student id between the two Exam
objects and return true if they both have the same student id number, and false
otherwise.
Note: you can add as many other methods as you need.
Show how this class, objects and its methods are being used and tested.
2. Write a function named “report” that accepts an array of Exam objects and its
array size. It will go through the given list of Exam objects and return the number
of exams that have “Passed” status, the minimum and maximum scores as well as
the pointer to the Exam object that has the maximum score (just one object if
there are multiple objects with the same max score). In another words, this
function will return 4 different values.
You can assume that the given array has at least one Exam.
Global variables are not allowed. Constants are ok.
There should be no usage of cin or cout in the method or in the class definition or
required functions. They should be handled using parameters and return values.
cin and cout can and should be used in the testing functions.
There should be only one “return” statement in a function or method. Multiple return
statements within the same function/method are not allowed.
Please pay attention to the required data types in the description.
tuple, list and
Please write C++ functions, class and methods to answer the following questions.
1. Define a new C++ class named “Exam” that manages simple exam information:
student id (integer) and a score (integer)
The class must provide at least the following two methods:
• isPassing which will return a boolean: true if the score is >=60 and false
otherwise
• toString method that returns the string containing all the information about
the Exam including the status of pass or fail. It is considered to have “Passed”
status when the score is >= 60 and “Failed” otherwise.
For example, here is the output for different Exam objects:
ID(1234) SCORE(100) STATUS(Passed)
ID(1235) SCORE(50) STATUS(Failed)
• isDuplicate method that compares the student id between the two Exam
objects and return true if they both have the same student id number, and false
otherwise.
Note: you can add as many other methods as you need.
Show how this class, objects and its methods are being used and tested.
2. Write a function named “report” that accepts an array of Exam objects and its
array size. It will go through the given list of Exam objects and return the number
of exams that have “Passed” status, the minimum and maximum scores as well as
the pointer to the Exam object that has the maximum score (just one object if
there are multiple objects with the same max score). In another words, this
function will return 4 different values.
You can assume that the given array has at least one Exam.
- 2 -
3. Write a function named isThisStudentPassing that accepts an array of Exam
object pointers, its size and the search student id. It will go through the given
array of pointers to find all the exams belong to that search student id. It will
return true if that student has all the exams with “Passed” status and false
otherwise. In another words, the student must pass all exams to return true. If one
of them failed, it will return false.
In addition, this function returns the number of exams belonged to that student.
4. Write a function named “createExamsForThisStudent” that accepts an array of
scores (integers), its size and a student id. It will create an array of Exam pointers
for that student, each element in the array will point to the Exam objects, one for
each score in the given array. This function will return the pointer to the first
element in newly created array.
5. Write a function named “endingWithSlashSlash” that accepts the same
parameters as command line arguments (argc and argv). It returns true if at least
one of the arguments have a “//” at the end and false otherwise.
This function also returns the number of arguments that have “//” at the end.
For example,
“//” will return true and 1
“one// two three// four” will return true and 2
“one” will return false and 0
“one two” will return false and 0
Please note that for question #5, you cannot refer or use string class, string
methods such length() or size() or any string function such as strlen(), strcmp
or strstr(). Please use only array notation, pointer to character, and/or pointer
arithmetic and make use of the fact that this is a C-string.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution!
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 1 images

Knowledge Booster
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.Recommended textbooks for you

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

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)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON

Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON

C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON

Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning

Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education