← Back to Templates
Question 164
Student Record Template
Student Record Template
Create a template classStudentRecord<T, U>that stores a student's name (typeT) and grade (typeU). The constructor takes two arguments:StudentRecord(T name, U grade)Implement: -print(): printsName: [name], Grade: [grade]followed by a newline Do NOT write a main function.
Expected Output:
Name: Alice, Grade: 95 Name: Bob, Grade: 88.5
= newline. The output ends with a newline — print one after the last line.
Hints2 available
Sign in to use hintsTopics:
Templates
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Shift+Alt+F to format · Ctrl+Space to expand shortcuts (cout, fori)
Your Output
Run your code to see the output here...
Test Cases
Run your code to see test case results.