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 seven steps of information gathering

Write and explain the seven steps of information gathering.

  Drawing crow-s foot erd using a specialization hierarchy

Given the following business scenario, create a Crow's Foot ERD using a specialization hierarchy if appropriate.

  Probability of heavy- normal and light snowfalls

Brenda evaluates the probability of heavy, normal, and light snowfalls as 0.25, 0.6, and 0.15, respectively. So what must be size of the order you would suggest to Brenda? Justify why.

  Finding decimal equivalent of eight bit numbers

Let the two 8-bit numbers A=01000001 and B=10000100. Provide the decimal equivalent of each number.

  Finding project schedule if critical path is identified

Describe in scholarly detail how you find out a project schedule once critical path has been identified.

  Explaining it acquisition issued request for proposal

A federal agency that does not use IT acquisition best practices issued a request for proposal that requires the contractor selected to use such practices, including certification at CMMI Level 3 or above.

  Explaining laws dealing with computer crimes

Write and explain three recent laws dealing with computer crimes.

  Rsa protocol to encrypt and decrypt messages

In this problem you are enquired to hand-turn RSA protocol to encrypt and decrypt messages by using rather smaller numbers than are used in practice, so that calculations can be done by hand.

  System development methodologies in information systems

There are literally thousands of system development methodologies in the Information Systems field. Suggest some reasons why there might be so many.

  Protect proprietary interest by addressing ethical issues

Advise whether you agree or disagree with CEO, specifically addressing ethical issues involved. Suppose you make a decision to hire a hacker, how would you protect your proprietary interests?

  Analysis of executive management team

Give a one to two page analysis summarizing the results to the executive management team of Omega.

  Benefits-negative effects brought by workplace automation

Write down at least three benefits and three negative effects brought about by workplace automation.

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