Error
There was an error loading the page.
Exploration activity: Define a class, add methods to it, then use it
Draft
In four parts, the student builds up the definition of a class representing a rectangle. First they write the constructor, then add methods to compute area and perimeter.
In the final part, they must use the methods to write a function which determines if a rectangle's area is larger than its perimeter.
Metadata
-
England schools
-
England university
-
Scotland schools
Taxonomy: mathcentre
Taxonomy: Kind of activity
Taxonomy: Context
Contributors
History
Christian Lawson-Perfect 3 years, 1 month ago
Published this.Christian Lawson-Perfect 3 years, 1 month ago
Created this as a copy of Exploration activity: Define a class, add methods to it, then use it.Name | Status | Author | Last Modified | |
---|---|---|---|---|
Exploration activity: Define a class, add methods to it, then use it | Needs to be tested | Chris Graham | 11/05/2023 08:07 | |
Exploration activity: Define a class, add methods to it, then use it | draft | Christian Lawson-Perfect | 04/07/2024 11:19 |
There are 5 other versions that do you not have access to.
Name | Type | Generated Value |
---|
last_code | string |
# Preamble (this will get repl
|
||||
validation1 | list |
Nested 4×2 list
|
||||
validation_area | list |
Nested 5×2 list
|
||||
validation_perimeter | list |
Nested 6×2 list
|
||||
validation_check_rectangle | list |
Nested 1×2 list
|
||||
postamble | string |
# Test variables
from random
|
Generated value: string
# Preamble (this will get replaced)
→ Used by:
- "Create the Rectangle class" - variable replacement
- "Add an area method" - variable replacement
- "Add a perimeter method" - variable replacement
Use this tab to check that this question works as expected.
Part | Test | Passed? |
---|---|---|
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet | ||
Code | ||
Hasn't run yet |
This question is used in the following exams:
- Manajit's copy of Programming extension demo by Manajit Chakraborty in Manajit's workspace.
- Programming extension demo by Christian Lawson-Perfect in Demos.
- claire's copy of Programming extension demo by claire lines in claire's workspace.
- Simon's copy of Programming extension demo by Simon James in Simon's workspace.
- Lars's copy of Programming extension demo by Lars Hansson in Lars's workspace.
- claire's copy of Programming extension demo by claire lines in claire's workspace.
- NUMBAS TRAINING claire's copy of Programming extension demo by claire lines in Brunel University Maths.
- Alexander's copy of Programming extension demo by Alexander Holvoet in Alexander's workspace.
- Mahdieh's copy of Programming extension demo by Mahdieh Zaker in Mahdieh's workspace.