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

  Explaining company-s internal operations

A company's internal operations and its relationship with suppliers and other busienss partners are frequently_________.

  Instruction cycle and finding contents of registers

Go over instruction cycle and find out contents of registers PC, AR, DR, AC, and IR for each of seven memory-reference instructions.

  Descriptions of data formats and to interpret raw data

The aim of this project is to exercise and test your ability to read and understand descriptions of data formats and to interpret raw data according to a particular format.  In this exercise you will produce and read the dump of a ZIP file.

  Procedure for checking suitcases for secret compartments

You are responsible for checking suitcases for secret compartments in which bulky items like jewelry might be hidden. Explain procedure you would follow to check for these compartments.

  Actions against company security camera

Joe the janitor is recorded on the company security camera one night taking pictures with his cell phone of the office of the CEO after he is done cleaning it. What will you do and what is your justification for your actions?

  Encrypting a message by crypto device

Crypto device encrypts every message into 20 bits of ciphertext.

  Explaining straight-line depreciation method

Explain in scholarly detail how to carry out Straight-line Depreciation Method calculations.

  Explaining os not designed for smartphones and pdas

which OS is not designed for smartphones and PDAs?1. Which OS is not designed for smartphones and PDAs?

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Feature set of free helix forensics cd

Visit Helix web site and read about feature set of free Helix forensics CD. Note that documentation for Helix is not on CD, to keep it down to ~700MB.

  Explain two standard apis supported by jaxp

Explain two standard APIs supported by JAXP (Java API for XML processing) and give a comprison between two mechanism.

  Explaining set of all regular languages is countable

Prove or disprove: the set of all regular languages is countable.

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