Answered step by step
Verified Expert Solution
Link Copied!
Question
1 Approved Answer

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

Step: 1

blur-text-image
Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Temporal Databases Research And Practice Lncs 1399

Authors: Opher Etzion ,Sushil Jajodia ,Suryanarayana Sripada

1st Edition

3540645195, 978-3540645191

More Books

Students explore these related Databases questions