CvLTAELG1AAv7GMjp8RSaPGsvS8 CS508 Assignment no 03 fall 2013 idea Solution required |
Thursday , 23 November 2017
Virtual University New old assignments, papers, GDB, Quizzez
Newest Assignments
You are here: Home - CS508 - CS508 Assignment no 03 fall 2013 idea Solution

CS508 Assignment no 03 fall 2013 idea Solution

 

Assignment No. 03
Semester: Fall 2013
Modern Programming Languages  (CS508)

 Total Marks: 15

 

Due Date:  23/01/2014

 Instructions:

Please read the following instructions carefully before submitting assignment:

 

  • You will submit your assignment before or on due date on VU-LMS.
  • Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
  • You should submit your MS Word File via assignment interface at VU-LMS.
  • Assignment sent via Email will not be replied and accepted/graded in any case.
  • If the submitted assignment does not open or file is corrupt, it will not be graded.
  • You will submit solution only in Microsoft Word File.

 

Objectives:

 

To understand and familiarize with Prolog Language.

 

 

For any query about the assignment, contact at cs508@vu.edu.pk or through MDB.

Assignment Questions

 Suppose you have the following observational data about sports students.


  • Nadia plays Basket Ball.
  • Maheen plays Basket Ball.
  • Sameena plays Basket Ball.

 

  • Raheel plays Basket Ball.
  • Fawaz plays Basket Ball.

 

  • Noureen plays Badminton.
  • Fahmeeda plays Badminton.

 

  • Zafar plays Cricket.
  • Fahad plays Cricket.
  • Noureen plays Cricket.
  • Imran Khan plays Cricket.

 

 

  • Fahad plays Badminton.
  • Sameena plays Badminton.
  • Raheel plays Badminton.
  • Zafar plays Badminton.

 

  1. 1.      Now being a prolog programmer answer the following questions:

 

Question # 1                                                                                                                              Marks 5     


Write the prolog rules for the followings.

 

 

  1.                                                        I.      If one plays Basket Ball and Badminton then one likes Football.

 

  1.                                                     II.      If  one plays Cricket and Badminton then one likes Football and Polo

 

  1.                                                  III.      If one plays only Cricket then one likes Polo.

 

  1.                                                  IV.      If one plays Cricket and Basket Ball then one is Smart.

 

  1.                                                     V.      If one plays Basket Ball then one is Active.

 

 

 

Question # 2                                                                                                                              Marks 10     

Write the prolog queries for the followings. These queries will be executed according to the facts and rules defined for the above given data and perform all steps to write the output of the given queries.

 

  1. a.      Who is  P that likes Football ?
  2. b.      Who is Q  that likes Football and Polo?
  3. c.       Who is R that  likes polo ?
  4. d.      Does Raheel play Basket Ball?
  5. e.       Do zafar and Imran Khan play Cricket?
  6. f.       Does X play Basketball and Badminton?

 

Note: In queries where variables are used along with answer write all the possible matches either they are true or not.

 

 

BEST OF LUCK

 

 

Leave a Reply

Your email address will not be published. Required fields are marked *

*

*