Skip to content

This repositiry documents my journey learning Haskell. It has exercises for every level of knowledge, from beginner to expert. Enjoy!

Notifications You must be signed in to change notification settings

NullaSec/Haskell-Exercises

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Haskell Exercises

Here are the Haskell exercises I've been solving on my journey learning this language. If you want to check the answers CLICK HERE.

Important note: The solutions work but that doesn't mean they're all the most efficient code you could make. Sometimes I use different ways of solving similar problems so that I can practice different stuff.

1. Output a temperature value in Farenheit after giving a value in Celsius.

NOTE: ºF = ºC x 1.8 + 32

2. Create the necessary functions to make a simple calculator: Addiction, Subtraction, Division and Multiplication

3. A game awards the players a certain amount of money based on their score. Create a function that calculates the amount of money given to the score input.

Score Prize in $
1 to 10 100
10 to 20 200
20 to 30 300
30 to 40 400
40 to 50 500
More than 50 600

4. The price of a plane ticket changes based on the age of the traveler. People over the age of 60 pay 60% of the total price. Children younger than 10 years old pay 50% and babies (younger than 2 years old) pay only 10% of the total price of the ticket. Create a function that given the age of the traveler and price of the ticket outputs the price they need to pay.

5. Create a function that receives a value and returns "True" if the value is an even number.

6. Function that displays the lowest number between two given numbers.

7. Function that displays the lowest number between three given numbers.

8. Create a function to calculate the area of a circle.

NOTE: Area = π x r²

About

This repositiry documents my journey learning Haskell. It has exercises for every level of knowledge, from beginner to expert. Enjoy!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published