Determine last element of a list using prolog

Assignment Help Basic Computer Science
Reference no: EM1348673

1. Using Prolog as the programming language for LOGIC, construct the relevant command to do the following tasks:-

Prolog Lists - A list is either empty or it is composed of a first element (head) and a tail, which is a list itself. In Prolog we represent the empty list by the atom [] and a non-empty list by a term [H|T] where H denotes the head and T denotes the tail.
(NOTE:- Given list MySenarai= [a,b,c,d,e,f, g, h] for the tasks listed below)

i. Find the last element of a list.

ii. Find the K'th element of a list. (K=5)

iii. Eliminate consecutive duplicates of list elements.

iv. Find the number of elements of a list.

Reference no: EM1348673

Questions Cloud

Illustrate what type of industry benefits the most : Illustrate what type of industry benefits the most from technological innovation? Select an article from either either a peer reviewed or current popular periodical on an industry of your choice and discuss this question from the perspective of th..
Introduction to cellular macromolecules : Cellular macromolecules to which a drug binds to initiate its effects are known as:
Determine the value of h : A 755N diver drops from a board 10m above the water's surface. Find out the diver's speed 5m above the water's surface. Then find the diver's speed just before striking the water.
Explain the role that the objective setting process : Explain the role that the objective setting process plays in how and if auditing objectives are met and what are some steps you can take to ensure that you consistently meet the objectives of an audit?
Determine last element of a list using prolog : Using Prolog as programming language for LOGIC, create relevant command to do following tasks:-Determine the last element of a list. Find K'th element of list. (K=5)
Calculate unit cost for toughenuf engines : A lawnmower manufacturing company built 1000 ToughEnuf engines driving the post year incurring the following direct cost
Explain what marketing channels are in regards direct sales : I want to say in four paragraphs that explain what marketing channels are in regards to (1) direct sales, social media, where I sell directly on the Internet or through advertising directed to the consumer
Calculate the transmitted intensity : Three polarizing plates whose planes are parallel are centered on a common axis. The directions of the transmission axes relative to common vertical direction.
Illustrate what are the major factors that have affected us : Illustrate what are the major factors that have affected U.S. household consumption since the recession in 2001.

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

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