Create a procedure that returns the last n items in the list

Assignment Help C/C++ Programming
Reference no: EM13881428

1. Create a procedure called (combine-four lst1lst2 lst3 lst4) that combines 4 lists into one list, in order of the given input lists.

2. Create a procedure that returns the last n items in the list lst.

3.1 Use a namedprocedure called (last-n lst n) to implement task.

3.2 Use an unnamedprocedure ((lambda (lst n) (. . .) '(1 6 3 4 5) 2) to implement task, where '(1 6 3 4 5) 2 are the arguments.

The unnamed procedure should give '(4 5)

3. Create a procedure called (first-nlst) that returns the first n items in the list lst. You must read in the value for n. You must not change the order of the list elements.

4. Create a procedure called (shuffle lst1 lst2) that returns a shuffle of two lists. Shuffle the lists by alternating elements between the two lists. You can assumethat both lists have the same length.

5. Create a procedure called (shufflePairs one two) that returns a shuffle of two lists in pairs. You can assume that both lists have the same length.

6. Create a procedure called (addSquare lst), where lst is a list of numbers. The procedure will calculate the square of each number in the list, add all the squared values, and then return the sum. If lst is empty, this procedure must return "empty list". If lst is not empty, the procedure should call another procedure called (addNonEmptyListlst) that returns the sum of square values of all elements in the lst. If lst is empty, (addNonEmptyListlst) procedure should return 0 (the value a the stopping condition). For example, (addSquare ‘(1 2 3)) should return the sum of 12 + 22 + 32

Note, you could use map function, but you do not have to use it.

Reference no: EM13881428

Questions Cloud

Explain how procurement cards provide for increased : Explain how procurement cards provide for increased efficiencies in the accounts payable department.
Prepare a journal entry that summarizes : Seven hundred vacation weeks earned in 2013 were not taken during 2013.
How are web browsers used in e-payables systems : How are Web browsers used in e-payables systems?
Explain why the availability of computer systems : Explain why the availability of computer systems in the receiving department is such an important component of an automated expenditures process.
Create a procedure that returns the last n items in the list : Create a procedure that returns the last n items in the list lst. Create a procedure called (combine-four lst1lst2 lst3 lst4) that combines 4 lists into one list, in order of the given input lists.
Identify compensating controls needed for an effective ers : Identify compensating controls needed for an effective ERS system.
Wellness event planning & promotion assignment : Wellness Event Planning & Promotion AssignmentObjective: Plan and promote a community wellness event related to a topic that you are interested Topic: Diabetes: Controlling Blood Sugar Levels
Theory of the term structure of interest rates : Why long-term financing is usually more expensive than short-term financing based on the theory of the term structure of interest rates?
What is an adventurous novel for me to read : What is an adventurous novel for me to read that includes powerful character development in modern society?

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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