Latest Activity In Study Groups

Join Your Study Groups

VU Past Papers, MCQs and More

We non-commercial site working hard since 2009 to facilitate learning Read More. We can't keep up without your support. Donate.


Assignment No. 03 Semester: Spring 2014 Modern Programming Languages (CS508) ||| Total Marks: 15 Due Date: 09/07/2013

Assignment No. 03
Semester: Spring 2014
Modern Programming Languages  (CS508)

 

Total Marks: 15

 

Due Date:  09/07/2013

 

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 students of college.

 

  • Zafar is adult and fasting in Ramzaan Ul Mobarak.
  • Rizwan is adult and fasting in Ramzaan Ul Mobarak.
  • Raza is adult and fasting in Ramzaan Ul Mobarak.

 

  • Imran is non adult but fasting in Ramzaan Ul Mobarak.
  • Saqib is non adult but fasting in Ramzaan Ul Mobarak.

 

  • Nazia is Healthy and Adult and Travelling.
  • Ammara is Healthy and Adult and Travelling.

 

  • Shafiq is Healthy and Adult and Travelling.

.

  • Imran is Healthy and non Adult and Travelling.
  • Raza is Healthy and Adult and Travelling.
  • Bushra is Healthy and not Adult and Travelling.

 

  • Bushra is under age and not fasting in Ramzan Ul Mobarak.
  • Nadia is under age and not fasting in Ramzan Ul Mobarak.

 

  • Shafiq has become ill and not fasting in Ramzan Ul Mobarak.
  • Salaman is above eighty and feeble and not fasting in Ramzan Ul Mobarak.

 

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

 

Question # 1                                                                                                                              Marks 5     

 

Write the prolog rules for the followings.

 

If one is fasting in Ramzan ul Mobarak then on is Adult.

If one is Fasting in Ramzan ul Mobarak then one is rewarded by ALLAH KARIM.

If one is non adult and fasting in Ramzan ul Mobarak then one is earning greater reward by Allah Karim.

If one is adult and healthy and travelling then one can keep left fasts in travelling after Ramzan ul Mobarak

If one is ill or of very old age feeble can give ransom for left fasts to needy 

 

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.      Is there adult X that can keep left fasts? 
  2. b.      Is there Y that can leave fast?
  3. c.       Who is M that earns greater reward by Allah Karim?
  4. d.      Is Bushra Fasting in Ramzan Ul Mobark?
  5. e.       Are Imran and Saqib keeping fast?
  6. f.       Who is Z adult and fasting?

 

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

 

 

BEST OF LUCK

 

Views: 1892

Attachments:

Replies to This Discussion

you are 70% wrong bro

this is not correct, you just have to use variables like X,Y..

in may Rules may kisi ka name nahe mention karna bro

handouts ka page # 79 ghor say parho or then complete karo ho  jay ge

RSS

Looking For Something? Search Below

VIP Member Badge & Others

How to Get This Badge at Your Profile DP

------------------------------------

Management: Admins ::: Moderators

Other Awards Badges List Moderators Group

Latest Activity

Ammara Sabir posted a discussion
20 minutes ago
Ammara Sabir liked 刀のの尺's discussion سامنے ہین ہم مگر! نظر آئین کس کو
30 minutes ago
Ammara Sabir liked 刀のの尺's discussion سامنے ہین ہم مگر! نظر آئین کس کو
30 minutes ago
Mani Siddiqui posted a status
"عین ممکن ہے کہ مجھ ہی میں کمی ہو لیکن سامنے آئے....محبت جسے راس آئی ہے"
33 minutes ago
Mani Siddiqui posted a status
"اُڑتے اُڑتے دُور اُفق میں آس کا پنچھی ڈوب گیا روتے روتے بیٹھ گئی آواز کسی سودائی کی"
34 minutes ago
Mani Siddiqui posted a status
"خوش دعوتِ یاراں بھی ہے ۔۔۔ یلغارِ عدو بھی کیا کیجیے دل کا ۔۔۔ جو کم آمیز بہت ہے"
35 minutes ago
Mani Siddiqui posted a status
"جس مصور کی نہیں بکتی کوئی بھی تصویر میری تصویر بنائے گا تو چھا جائے گا"
36 minutes ago
Mani Siddiqui posted a status
"کوٸی دشمن کو یوں نہ دیکھے گا جیسے قسمت کو دیکھتا ہوں میں"
40 minutes ago

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service