辅导案例-COMP 3023

欢迎使用51辅导,51作业君孵化低价透明的学长辅导平台,服务保持优质,平均费用压低50%以上! 51fudao.top
/HOME  MY COURSES  COMP 3023  ASSESSMENT  PRACTICE EXAM
/Question 5
Not yet
answered
Marked out of
17.00
Write code for a class called AssessmentTask representing an abstract assessment item that
has a name (of type std::string ), can be attempted, graded, and can possibly be extended.
Further, the class MUST provide:
. a constructor that initialises the name to one that is given
. a virtual member function extendDeadline() with a default implementation that
outputs "This task cannot have an extension." to the console
. a pure virtual member function grade() that returns an object of type std::string
. a pure virtual member function attemptCount() that returns an int .
. a pure virtual member function assignGrade(...) that takes a parameter of type
std::string representing the grade (e.g., 'HD', 'D', 'C') being assigned (and returns
void ),
. a pure virtual member function recordAttempt() (that takes no parameters and returns
void )
. a private data member called _name of type std::string ,
. a means of accessing the name by subclasses, but not from outside the AsessmentTask
class hierarchy
Write the class with all the code embedded in the class (you do not need to separate the
header from the source file).
Comments are unnecessary.
You must also consider:
when variables and objects should be unmodifiable, e.g., using const in appropriate
places
best practice for passing parameters
what includes are necessary
/
/Question 6
Not yet
answered
Marked out of
11.00
The real exam will have a follow-up question or two asking you to create a concrete class
related to the previous abstract class, and then write a main function that performs certain
tasks using the defined classes.

欢迎咨询51作业君
51作业君

Email:51zuoyejun

@gmail.com

添加客服微信: abby12468