Write two small functions involving tuples

Assignment Help Programming Languages
Reference no: EM132262902

Programming Languages Assignment: two small F# functions

Overview - In this assignment write 2 small functions involving tuples; you can solve using recursion, higher-order, or both. The exercise is setup on Codio, but you can work in whatever environment you prefer. Regardless of where you work, be sure to submit the two functions separately as described in the next section.

Exercises -

Exercise 1: examAverages LT

Given a list of tuples of the form ("netid", [score;score;score;...]), computes each netid's average score as a real number and returns a list of tuples of the form ("netid", average).

NOTE: F# offers a function List.average L that computes the average of a list of real numbers. However, the list of scores in the tuple are integers, so in order to use List.average, you would first need to convert the integers to reals --- List.map float L would work nicely here.

You can solve using recursion, or higher-order, or both; tail recursion is not necessary.

Write the required function, using whatever approach you prefer. To test your work, open a terminal window and load the file into F# interactive like we did in the previous homeworks. [If you need an example of using F# interactive, please see page 2 of the HW #08 handout.]

Exercise 2: pairwise L1 L2

Edit the file "hw1002.fs". Read the comments, implement as you see fit, test using F# interactive.

Given 2 lists L1 and L2, both the same length, merges the corresponding elements into pairs, returning a list of pairs.

You can solve using recursion, or higher-order, or both; tail recursion is not necessary.

Attachment:- Assignment Files.rar

Reference no: EM132262902

Questions Cloud

Develop a com comprehensive orientation plan : Would you choose to develop a com comprehensive orientation plan? A gene company rationale what would you include?
Describe best practices for recruitment and hiring processes : Describe best practices for recruitment and hiring processes. Demonstrate basic knowledge of labor law and collective bargaining agreements
What is the difference between training and development : What is the difference between training and development and what are the three steps included in both?
Optimum level of staff efficiency and guest service : Gill Bates, manager of the Bates Hotel, is considering how to restructure the front desk to reach an optimum level of staff efficiency and guest service.
Write two small functions involving tuples : CS 341 Programming Languages Assignment: two small F# functions. In this assignment write 2 small functions involving tuples
Franchise different from an independent business : In a detail explanation with references, how is a franchise different from an independent business? And what are the pros and cons of purchasing a franchise?
Identify prevention interventions for each phase : Identify prevention interventions for each phase. Identify how the interventions would vary for each sex offender based on their risk level.
Discuss about the human and family systems : Substance abuse always affects the family and other systems. What is ironic (a paradox) is the abuse negatively affects the members of the system.
What are the quantitatives methods to project evaluation : What are the quantitatives methods to project evaluation?

Reviews

len2262902

3/21/2019 11:16:19 PM

Submission: submit electronically on Gradescope. Individual work only, late work not accepted. Regardless of where you work, be sure to submit the two functions separately as described in the next section. Note: if you added additional code to the files for testing purposes, such as a main() function, you’ll need to comment out / delete that code before submitting.

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd