Write a program to create map function, Programming Languages

Given a list of numbers, say

my @input_numbers = (1, 1, 3, 5, 8, 13, 21, 34, 55, 89, 144);

write a program map1.pl that will use the function map

(a) to produce a list of numbers where each number is 100 greater than the number in the original list

(b) an hash where the numbers from the original list are the keys and their squares are the values

(c) a list containing the digits of the numbers ending in 4

comp315@turing> map1.pl

101 101 103 105 108 113 121 134 155 189 244

21 => 441

3 => 9

8 => 64

1 => 1

34 => 1156

144 => 20736

89 => 7921

13 => 169

5 => 25

55 => 3025

3 4 1 4 4

Posted Date: 3/12/2013 1:37:41 AM | Location : United States







Related Discussions:- Write a program to create map function, Assignment Help, Ask Question on Write a program to create map function, Get Answer, Expert's Help, Write a program to create map function Discussions

Write discussion on Write a program to create map function
Your posts are moderated
Related Questions
Implement a two-dimensional table in Prolog. Your program will contain: An insert_entry predicate that takes a table, row, column and an entry and inserts the entry at the g

Consider the following schema (DTD) and sample instance document: name    ID      #REQUIRED spouse  IDREF   #IMPLIED job     CDATA   #IMPLIED > ]>

Use list recursion to de ne the function mySum which takes as input an integer and a list of integers and returns the list obtained by adding every element of the list by the rst

Given strings s 1 and s 2 of lengths m and n respectively, a minimum cover of s 1 by s 2 is a decomposition s1 = w 1 w 2 .... wk, where each w i is a non-empty substring of s

how to save bulk entries at a time using collections?


Board Coloring Problem Description In this problem you are given a board in which some of the elements are placed as shown in diagram below. Each element represents a color.

i want to record in database but how to delete only duplicate field not row in vb 6.0 or ms-access

Let us first see the skeleton of a JavaScript file. JavaScript code should be written between the and tags. The value LANGUAGE = "JavaScript" indicates to the browser that J

SailDublin Ferry provides ferries to mainland Britain, Europe and America. Having observed the success of Irish ferries and Stennaline online booking system; SailDublin ferry has d