Saudent number Part 3 PROGRAMMING (40%) in C++. Declare a c ber variables name,
ID: 3907374 • Letter: S
Question
Saudent number Part 3 PROGRAMMING (40%) in C++. Declare a c ber variables name, information of the studesnt since it will not be changed ted. Create a constructor with two arguments for student name and number, respectively. ish and h, and Math, and a member function print that displays the int including these member stwdent No should be Initialize the studentNo in the constructor is list. Define two to set the values of English and Marh, respectively. Set all variables to private and functions to ing a student object, set English to 100 and Math public. Write a main function to test the class by creat to 90, and calling the prin member function #include #include using namespace std; class Student f //here declare member variables of students /here you inline functions declare and define a constructor and member functions, you can use J: //define the constructor and member functions here if you do not use in-line int mainO Student s1( Jone" ,123); s1.setEnglish(90); s1.setMath(100); s1.printO: CSCI 2004Explanation / Answer
#include #include using namespace std; class Student { private: string name; int studentNo; int English; int Math; public: Student(string n, int s) { name = n; studentNo = s; } void setEnglish(int e) { English = e; } void setMath(int m) { Math = m; } void print() { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.