Assignment Inheritance and Overriding Functions

Published by Mario Oettler on

Write a contract named “Basic” and define a function called setValues in it. This function should take two parameters of type uint256 and string. The parameters should be stored in a public state variable each.

Write another contract named “Extended” that inherits from “Basic” and overrides the function setValues. The value of the uint256 variable should be changed to 10 if the parameter is larger than 10. Both values (uint256 and string) should be saved in a public state variable.