Question

Represent each statement as a PROLOG statement: The population of Zambia is 13 million.     [1 mark]...

  1. Represent each statement as a PROLOG statement:
  1. The population of Zambia is 13 million.     [1 mark]
  2. Zambia is a landlocked country.          [1 mark]
  3. Soldiers are men who are over 170 m tall.       [2marks]
  4. You are British if you are Welsh, English, Scottish or Irish. [2 marks]
  5. Those who play football, hockey or rugby are sportspeople. [2marks]
  6. Two people are siblings if they have the same parents. [2 marks]
  7. Two people live in the same house if they have the same address. [2 marks]
  8. Someone is healthy if they are healthy, wealthy or wise. [2 marks]

Section B

  1. Write a simple Prolog program that should be able to compute the volume of a cylinder. It should have the following menu:   [20 marks]

*****CYLINDER_VOLUME*****

Enter the radius:

Enter the height:

HINT: Volume of a Cylinder = Vr2 husgwwawgAAAABJRU5ErkJggg==,

              π = 3.142

  1. Write a simple prolog program that should find the roots of a quadratic equation.[20 marks]

0 0
Add a comment Improve this question Transcribed image text
Answer #1

a) population (Zambia ,13 million)

b)landlocked country(Zambia)

c)soldiers(men, height, above 170m)

d) isWelsh, English, Scottish,Irish(You) :- British

e)sportspeople(play ,football, hockey rugby )

f)parents(Same):- Sibling

g)Same(lives):- Address

h)healthy, wealthy or wise(Simeone):-healthy

SECTION B:

predicates
    start.
    volume.    
clauses

        start:- volume,nl.

        sum:-     write(\"Enter the radius: \"),readreal(r),
            write(\"Enter the height:"),readreal(h),
            V = 3.1412*r*r*h
            write(\"VOLUME=\"),write(V).

goal
    start.

> what commands can you run in prolog so that it can calculate...?

Mangani Zulu Thu, Apr 21, 2022 2:08 AM

Add a comment
Know the answer?
Add Answer to:
Represent each statement as a PROLOG statement: The population of Zambia is 13 million.     [1 mark]...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • 1. Private data fields: name (of String type, initialized to “Bob”), endurance (of int type, initialized to 4) and happiness (of int type, initialized to 3);

    Language: JAVAPart a: Write a class called Geniegotchi with:1. Private data fields: name (of String type, initialized to “Bob”), endurance (of int type, initialized to 4) and happiness (of int type, initialized to 3);2. Public methods:-void setName(String newName) : renames Genie with newName, printsnewName confirmation to screen;void setName(String newName) : renames Genie with newName, printsnewName confirmation to screen;- intgetEndurance() : returns current endurance;-intgetHappiness() : returns current happiness;-void feed() : this method increases current endurance by 1 if endurance is less...

  • Read about Cokes strategy in Africa in the article below and discuss the ethics of selling...

    Read about Cokes strategy in Africa in the article below and discuss the ethics of selling soft drinks to very poor people. Is this an issue that a company like Coke should consider? Africa: Coke's Last Frontier Sales are flat in developed countries. For Coke to keep growing, Africa is it By Duane Stanford Piles of trash are burning outside the Mamakamau Shop in Uthiru, a suburb of Nairobi, Kenya. Sewage trickles by in an open trench. Across the street,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT