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

  Program to calculate volume flow rate in cubic feet

Write a program to calculate the volume flow rate in cubic feet per second of water flowing through a pipe of diameter d in inches and a velocity of v feet per second.

  Write program to prompt user to enter year-find leap year

Write down program to prompt the user to enter year, and then tells user whether it is leap year. If user doesn't enter valid year (i.e., a positive integer).

  Design a c# windows phone 8 application

Design and implement a C# Windows Phone 8 application based on the SoundBoard app in the Windows Phone 8 Development for Absolute Beginners textbook.

  Write recursive function to return maximum element of array

Write down the recursive function which receives three parameters: The recursive function must return maximum element of array.

  Program to calculate monthly gross pay for super supermarket

Owners of Super Supermarket would like to have program which calculates monthly gross pay of their employees. Input for this program is employee ID number, hourly rate of pay.

  Design a benefits election system

Individual project for this course is in form of Service Request from Huffman Trucking. It is essential for student to access Service Request: SR-ht-001. Design a Benefits Election System.

  Write a c function called values that returns void

Write a C function called values that returns void and takes two double precision arguments (called a and b) and one double precision array argument.

  Write simple program to prompt user for gross salary

Write simple program which will prompt user for his or her gross salary. Your program than will display net salary whereby 11.00% of the gross salary is deducted for EPF

  Write program which asks user for names

Write down a program which asks user for names (Prompt user with something like "Enter a name, or q when finished"), assigns new Person (in heap memory) for each of them.

  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.

  Write techniques to ensure the site content is optimized

All Web pages is as small as possible without affecting the look and feel of the final product. What are some techniques to ensure the site content is optimized?

  Explain a script namedmyfind.sh that performs a subset

Write a script namedmyfind.sh that performs a subset of the find command. Your script must handle the following options:-name, -type, -newer, -maxdepth, -mindepth, and-exec

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