HW08: Gym membership

Problem statement

Implement a smart contract for gym membership management.

Example scenario

Alice owns a gym. She creates an instance of this contract to manage memberships. Bob soon buys a membership for 30 days. Every time Bob visits the gym, he shows his public address QR code to the receptionist, who scans it and checks Bob's membership through the smart contract.

Contract interface

Contract skeleton

pragma solidity ^0.4.21;

contract GymMembership {

    // <contract_variables>

    // </contract_variables>

    function GymMembership(uint256 dailyPrice) public {
        // TODO
    }

    function register(uint256 numDays) public payable {
        // TODO
    }

    function validate(address client) public view returns (bool) {
        // TODO
    }

    function withdraw() public {
        // TODO
    }

}