Implement sumpairs and sumof

Assignment Help Programming Languages
Reference no: EM13712966

You have to implement sumPairs and sumof.

Question- Using SML writes a version of sumPairs that sums each component of the pairs separately, returning a pair consisting of the sumof the first components and the sum of the second components

fun sumPairs(nil) = 0

| sumPairs((x,y)::zs) = x + y + sumPairs(zs);

val sumPairs = fn : (int * int) list -> int

Please keep it simple and short and no copy and paste or at least help me get started?

Reference no: EM13712966

Questions Cloud

Writes a function that takes a list of integers : Using ML writes a function that takes a list of integers as argument and returns a pair consisting of the sum of the even position and the sum of the odd positions of the list. You should not use auxiliary functions
Determine the empirical formula of the compound : A compound contains C, H, O, and N. On combustion in air, a 0.157g sample produced 0.213g CO2 and 0.0310g of H2O. In a separate experiment, a 0.103g sample produced 0.0230g of NH3. Determine the empirical formula (include C, H, O, and N) of the co..
Explain produced from electrolysis of molten na2cro4 : How much chromium metal can be produced from electrolysis of molten Na2CrO4 using 15 milliamps for 12 hours
Explain difference between formula units and molar mass : Please explain the difference between Formula Units and Molar Mass. Discuss what a "Kelvin" is and for what it is used.some details please. Does a baseball have a deBroglie wavelength? If no, why not? If yes, why can't we see it?
Implement sumpairs and sumof : Using SML writes a version of sumPairs that sums each component of the pairs separately, returning a pair consisting of the sumof the first components and the sum of the second components
Define riboflavin stock in order to create a solution : What volume of water should be added to 7 mL of a 10 mM riboflavin stock in order to create a solution with a working concentration of 350 uM
Draw the process tree and expected output : Draw the process tree and expected output, Repeat the exercise using 3 instead of 2 in the for statement
What was the concentration of hcl in the original solution : A 3 mL volume of a solution containing an unknown concentration of HCl is added to 7 mL of water. It is then determined that the concentration of the HCl in the diluted solution is 630 mM. What was the concentration of HCl in the original solution
Examine the time and space complexity of algorithm : Some DNA strings can transform to other strings by breaking into contiguous substrings, reversing some of these substrings, and then reconnecting the substrings in the original order.

Reviews

Write a Review

Programming Languages Questions & Answers

  Problem 1you have gathered the following information for a

problem 1you have gathered the following information for a friend who manages a restaurant. you will use this data for

  Design interactive program using prewritten methods

Design an interactive program that does the following, using the prewritten methods whenever they are appropriate. Prompt the user for and read a library card number, which must be between 1000 and 9999.

  Build a student record managing system application

Build a student record managing system application

  Calculate the amount of profit and loss

Calculate the amount of profit and loss. Also if Profit then display the smiley face, if loss then display sad face and if break even then confused face.

  Create an xml file with markup tags

Create an XML file with markup tags and some sample data to represent a list of invoices. Include the XML tags for two invoices in the list.

  Find out what kind of external resources it is using

find out what kind of external resources it is using. To deeply understand it, you may also try to figure out why it uses which resources.

  Question 1please define sexual harrassment in addition what

question 1please define sexual harrassment. in addition what was discussed in the discussion section of this class

  Using a software program to create story books

submit a unit plan spanning Two to Four weeks. See this example of a unit plan, (or search the web for a unit plan example that best suits matches your needs). Technology should be integrated for assessment, instruction, and student engagement..

  Write a web application which will give report of balance

Write a web application which will provide a report of the balance held in the visitor's account during the past several months.

  Create test application that creates objects of type book

Create a test application that creates several objects of type book class and adds each Book to an ArrayList. Your test application should then do the following.

  Direction and magnitude be integers or doubles

Design the program consider Will the direction and magnitude be integers or doubles - will the input vectors be passed by value, by reference, or by const reference?

  Write a recursive-descent parser

Use any programming language you prefer to write a recursive-descent parser that parses the language generated by the following EBNF descriptions.

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