Created
March 4, 2026 03:40
-
-
Save renso3x/ae6aaf7791667170536e6755eb67bed3 to your computer and use it in GitHub Desktop.
Activity Three
This file contains hidden or 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
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.31; | |
| contract Activity_3 { | |
| // Celsius to Fahrenheit Converter - Make a function that will convert Celsius to Fahrenheit. | |
| function celsiusToFahrenheit(uint celsius) public pure returns (uint256) { | |
| return (celsius * 9/5) + 32; | |
| } | |
| // Make a function that will convert hours to seconds. | |
| function convertHoursToSeconds(uint256 hr) public pure returns(uint256) { | |
| return hr * 60 * 60; | |
| } | |
| // Make a function that will compute the average of three numbers. | |
| function averageOfThreeNumbers(uint256 a, uint256 b, uint256 c) public pure returns(uint256) { | |
| return (a + b + c) / 3; | |
| } | |
| // Make a function that converts Eth to dollars | |
| function convertEthToDollars(uint256 ethAmount) public pure returns(uint256) { | |
| return ethAmount * 2000; | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment