Assignment Inheritance and Overriding Functions

Published by Mario Oettler on

Last Updated on 23. March 2023 by Martin Schuster

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.

Categories:

https://blockchain-academy.hs-mittweida.de/wp-content/uploads/2021/04/logo_bcam_rgb_gross.png

Welcome

Blockchain Academy

Continue with credential

No account yet?

Powered by Hidy

Register with Hidy


Register
Sign in

We need the following credential to register:

please select:

To create a new account, we need the following data from you:

We would appreciate the following additional information from you for the creation of your account:

Welcome

Blockchain Academy

Continue with credential

Already have an account?

Powered by Hidy

Sign in with Hidy


Register
Sign in

We need the following credential to log in:

please select: