4. [2 marks] Consider a class that represents an "electric vehicle". Write the most appropriate names for each of the fo
Posted: Mon Jun 06, 2022 12:48 pm
4. [2 marks] Consider a class that represents an "electric vehicle". Write the most appropriate names for each of the following parts of that class: a. the module (file) name b. the class name c. a method that charges the electric vehicle d. an attribute variable that represents whether the electric vehicle is fully charged 5. [5 marks] For each of the scenarios below, explain what data structure (Python variable type) would be the best choice and why. a. Storing a user's weight b. Storing a year's worth of temperature reading c. Storing a collection of colours that allows the coder to get their colour codes based on their common names d. Storing the on/off state of a light bulb e. Storing a student's details (student number, name, address, etc.) 6. [3 marks] Given the below pairs of classes, describe their relationship using the following options: - is unrelated to - is an instance of - is a child of - is composed of e.g. if the pair is "Animal - Dog", the answer is "Dog is a child of Animal" Note that you might need to swap the order to use the provided relationships. a. Person - BodyPart b. Avocado - Food c. Desk - Computer d. Microphone - InputDevice e. Student Lecturer f. Jim - Person