To the faculty page of James Tam Return to the course web page

CPSC 231: Mini-Assignment 4

Due at 4 PM. For assignment due dates see the [main schedule] on the course webpage.

New Concepts to be applied for the assignment

Only new concepts that need to be applied in the assignment are listed, concepts previously applied in other assignments may need to used in the implementation of your solution.

Functional requirements

Your program must consist of two classes (as described below). Aside from the 'start()' function you are not to define any other functions for this assignment.  If you do implement other functions or methods then you will receive few, if any, marks for features listed below. Make sure you use the same method names specified. Also to make it easier to mark ensure that your method carries out the prescribed tasks exactly as specified (so the the person knows precisely what results should come out at what times).

Details

 
  • Attributes: name (String), and health (int) (0.5 GPA)
 
  • Methods:
     
  • A no argument constructor that sets the name and health attributes to the following default starting values ("nameless" for the name and -1 for the health (0.8 GPA)
  • A 'gainLevel()' method that displays a message onscreen ("Congratulations!") and increases health by 5. (0.8 GPA)
     
 
  • Declares a reference to an Adventurer and calls the default constructor. (0.3 GPA)
  • Displays the health and name of the adventurer, the default values appear. (0.5 GPA)
  • Sets the name of the adventurer to 'Balin'. (0.3 GPA)
  • Calls the 'gainLevel()' method of the adventurer. (0.3 GPA)
  • Displays the health and name of the adventurer, the new values should appear 'Balin' and and a non-default value for the health (increased by 5 over the default). (0.5 GPA)

How to do determine 'how you did' on an assignment? (Short answer: you can thoroughly test your program and become familiar with non-functional requirements)

Program functionality (implementing working program features)

  • Test your program: Because the assignment description (along with required features) is posted ahead of time if you test your program thoroughly before submitting the final version then you should get a pretty clear idea of "how you will do".

Style and documentation (non-functional assignment requirements)

  • To keep the marker's workload reasonable and to reduce marking time unless otherwise specified in the description these things will not factor into the grading of mini-assignments.

Non -functional assignment requirements (style and documentation).

Although it won't affect your grade for mini-assignments you should still practice applying good style in your solution as well as writing documentation. It will keep your skills for the full assignments (when you will be graded on these things) and get you used to having good habits.

Marking and grading

Collaboration:

Assignments must reflect individual work; group work is not allowed in this class nor can you copy the work of others. Some "do nots" for your solution: don't publically post it, don't email it out, don't show it to other students; don't even verbally discuss solutions to any graded work (i.e. you can't do this in an exam so you can't do this for assignments). And unless otherwise told you should not use program code for other sources (which include but aren't limited to: tutors, artificial intelligence programs such as ChatGPT). For more detailed information as to what constitutes academic misconduct (i.e., cheating) for this course please read the following [link].

Method of submission:

Reminder: You are to submit your assignment using D2L [help link]. Make sure that you [check the contents of your submitted files] (e.g., is the file okay or was it corrupted, is it the correct version, it is the correct file etc.). It's your responsibility to do this! (Make sure that you submit your assignment with enough time before it comes due for you to do a check). If don't check and there were problems with the submission then you should not expect that you can "learn your lesson" and simply resubmit. Whatever you submitted into D2L by the final due date is what will be marked.

D2L configuration for this course

Late submissions for full assignments  when there is no extension granted: Make sure you give yourself enough time to complete the submission process so you don't get cut off by D2L's deadline (or your submission will be automatically flagged as late by D2L and it will be graded appropriately)..

Submission received:

On time

Hours late : >0 and <=24

Hours late: >24 and <=48

Penalty:

None

-1 GPA

-No credit (not accepted)

General use of pre-created Python libraries:

Unless otherwise told you are to write the code yourself and not use any pre-created functions (or methods). For most assignments the usual acceptable functions include: print()input() and the 'conversion' functions such as int()float()str(). In addition you use functions or methods with text formatting capabilities such as 'format()' or the 'write()' method of the 'sys' library module. You can use any method that you wish (e.g. using format specifiers or the 'format' method) to set the precision for the output. Look at the particular assignment description for a list of other functions/methods that you are allowed to use and still get credit in an assignment submission. If it's not listed then you should assume that you won't be able use the function and still be awarded credit.