-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d9fe072
commit 697f1c0
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity >=0.5.0 <0.9.0; | ||
|
||
contract Day1 { | ||
//Create a variable of enum type. | ||
enum House { | ||
SMALL, | ||
MEDIUM, | ||
LARGE | ||
} | ||
House choice; | ||
|
||
//Create a function setLarge(). This will set the value of the enum type variable (created at step 1) with LARGE. | ||
function setLarge() public { | ||
choice = House.LARGE; | ||
} | ||
//Create a function getChoice() which will return the value of the enum type variable (created at step 1) . | ||
function getChoice() public view returns (House) { | ||
return choice; | ||
} | ||
|
||
} |