Skip to content

Pull new content #11

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions Homework/Homework01/Homework01.hs
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@

-- Question 1
-- Write a multiline comment below.
{- This is a multiline comment.
Yes, it is! -}

-- Question 2
-- Define a function that takes a value and multiplies it by 3.
multiplyBy3 x = x * 3

-- Question 3
-- Define a function that calculates the area of a circle.
areaOfACircle r = pi * r^2

-- Question 4
-- Define a function that calculates the volume of a cylinder by composing the previous function together with the height of the cylinder.
-- Define a function that calculates the volume of a cylinder by composing the previous function together with the height of the cylinder.
volumeOfACylinder r h = areaOfACircle r * h

-- Question 5
-- Define a function that takes the height and radius of a cylinder and checks if the volume is greater than or equal to 42.

-- Define a function that checks if the volume of a cylinder is greater than or equal to 42.
checkVolume r h = volumeOfACircle r h >= 42