Question: Using F# write, compile and test the following simple programs. You should check the examples and programs we worked on in class using the dotnetfiddlecommand
Using F# write, compile and test the following simple programs. You should check the examples and programs we worked on in class using the dotnetfiddlecommand line tool.
Try to avoid using imperative constructs as much as possible.


1. Implement an add function. Run the following tests. a. add 25 15 b. add 18 34 23 19 2. Write a program that uses loop. Compute the average of a list of integers. Use List comprehensions to generate the List. List comprehension refers to special syntactic constructs (ex: ranges and generators) used for generating lists 3. Write a function round that takes an integer argument and implements the following expression: if x ?= 100 return 100 eif x ? 0 return 0 else x Write a program that implements the expression using a. if-then-else, and then using b. Pattern matching Test the program for different values of x to test the various conditions
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
