Menu
Coddy logo textTech

Entry Rules

Part of the Fundamentals section of Coddy's Solidity journey. Lesson 20 of 53.

challenge icon

Challenge

Medium

A visitor needs a pass and must not be suspended. If hasPass is false or suspended is true, print denied. Otherwise print junior for ages below 18 and adult for ages 18 or more.

The tests pass arguments to main in this order: bool hasPass, bool suspended, uint256 age. Each test starts with fresh contract state.

Use console.log for the requested output. Print only the requested values, one per line, with no extra labels unless the task specifies them.

Try it yourself

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.26;
import "forge-std/console.sol";
contract Main {
    function main(bool hasPass, bool suspended, uint256 age) external view {
        // Write your solution here.
    }
}

All lessons in Fundamentals

Practice on your own: Solidity playground