Write a class name StudentRecord with the following specifications –
• Data members:
name, marks[], major, term (use appropriate data type)
• Member functions:
o You are allowed to leave the constructor default
o Implement all get/set methods
o double findAverage( ) – returns the average mark of the student
o void displayProfile( ) – displays the profile of a student in following manner:
Name: John Smith
Major: Computer Science
Term: Fall 2015
Term average: 90%
• Main function:
o Take input from user for name, major and term name
o Take input from the user for 5 courses s/he has enrolled in this term (you must
put a validation checking that the range of input such that 100<=marks>=0) o Create an object of StudentRecord class
o Set name, major, term name and the marks[]
o Invoke displayProfile() function to display the information of the student
• Special instruction: You MUST submit following 3 files –
o StudentProfile.h
o StudentProfile.cpp
o StudentProfileMain.cpp
Don't post homework questions
Programmers are good at spotting homework questions; most of us have done them ourselves. Those questions are for you to work out, so that you will learn from the experience. It is OK to ask for hints, but not for entire solutions.
So what do you have so far? If you have your class all defined and ready you just need to create and instance in main and use the methods you created to modify said instance.
Thank you!
How would I go about getting the average of the 5 user input numbers and displaying it?
I know that I have to put in a for loop for the:
'void studentRecord::setMarks(int mark[])'
but i don't know how to go from there