Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create the Student class in C++. Each student should have a level (initially is

ID: 3744743 • Letter: C

Question

Create the Student class in C++. Each student should have a level (initially is 0) Create the main method, create an object of the Student class in dynamic memory Use cout to print your object. Create a function rank student that receives a pointer to a Student object and increase the rank of the Student object by 1. Use cout to print the object after calling the rank_student function over the object.

Explanation / Answer

#include using namespace std; // 1. Student class class Student { public: int level; Student() { level = 0; } }; // 4. rank_student to increase rank of student void rank_student(Student *s) { s->level++; } int main() { // 2. dynamically create student Student *s = new Student; // 3. cout to print object cout
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote