Question: home / study / engineering / computer science / computer science questions and answers / haskell question: please use haskell to writtinig the following code:

home / study / engineering / computer science / computer science questions and answers / haskell question: please use haskell to writtinig the following code: 1. write a haskell program ...

Your question has been answered

Let us know if you got a helpful answer. Rate this answer

Question: Haskell Question: please use haskell to writtinig the following code: 1. Write a Haskell program ...

Haskell Question:

please use haskell to writtinig the following code:

1. Write a Haskell program named getbmi.hs. It will ask the user to input weight in pounds (not kg, you have to convert to kg later) and inches (again, non metric). Perform any conversions needed, calculate BMI, then print the BMI, along with the string messages of the earlier BMI functions we wrote in lecture ("You're normal", etc.) depending on the BMI number.

earlier BMI code:

bmiTell :: (RealFloat a) => a -> String bmiTell bmi | bmi <= 18.5 = "You're underweight" | bmi <= 25.0 = "You're normal" | bmi <= 30.0 = "You're overweight" | otherwise = "You're obese"

2. Write a Haskell program named leetcode. It asks for a phrase, and it converts all lowercase o's to 0, all lowercase e's to 3, all lowercase a's to @, and all lowercase l's to 1, and prints the result to the screen.

3. Write a Haskell program that inputs a file (the file path is hardcoded in your program for now) and does the same thing with the text as the previous problem, but instead of printing to the screen, it prints it to a file called leet.txt, in the same directory as the original file.

Submit a haskell script for each.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!