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
i have a=[0 1 1 2 2 3 6 7 0 4 ] i want to delent elemet but keep its position i.e a(4)=[] it gives me 0 1 1 2 3 6 7 0 4 but i need 0 1 1 [] 2 3 6 7 0 4

As an XML expert you are required to model a system for an online bookshop. After an interview with the shop manager you have the following information: The detail of th

Write a Prolog predicate remove_nth(N,L1,L2) that is true if list L2 is just list L1 with its Nth element removed. If L1 does not have an Nth element then the predicate should fail

I need help with having a user input a year, and my program to spit out what day of the week Christmas is on.... any helping hands on this?

Task 1 Think about a Web site you would like to work on for Assignment 2. For example, you can do a personal interest site, a site for your favourite nonprofit organization,

You are required to develop a content management system for the following scenario:   "A Travel Information (NTIK) system is to be designed to allow travellers to access to an elec

ASP.NET Support for AJAX and JavaScript IntelliSense IntelliSense for Enthusiasm JScript makes it accessible client-script selection components in the value manager in Vision Facil

I need help with this question. The problem i''m having is that what''s the syntax for using dynamic memory allocation of objects of one class in the constructor of some other clas

In this assignment, you will design a program to perform the following task: Calculate the total price to purchase all the components required to build a state-of-the-art gaming c

What are the main pros and cons of assembly programming language?