943,911 Members | Top Members by Rank

Ad:
Jun 5th, 2008
0

Mohamed Shahabudeen in need of help!

Expand Post »
Hey this is Mohamed Shahabudeen. Can someone please help me with the following!




Enter the following program called “composers.pro”

% This database is about composers
% Datarecords: composer’s last name, birth and death year

composer (monteverdi, 1567, 1643).
composer (bach, 1685, 1750).
composer (vivaldi, 1678, 1741).
composer (mozart, 1756, 1791).
composer (haydn, 1732, 1809).
composer (beethoven, 1770, 1827).
composer (kreisler, 1875, 1962).
composer (salieri, 1750, 1825).
composer (sammartini, 1700, 1775).
composer (scarlatti, 1660, 1725).
composer (schubert, 1797, 1828).
composer (schumann, 1810, 1856).
composer (tchaikovsky, 1840, 1893).
composer (brahms, 1833, 1897).
composer (verdi, 1813, 1901).
composer (debussy, 1862, 1918).
composer (stravinksy, 1882, 1971).
composer (wagner, 1813, 1883).
composer (chopin, 1810, 1849).
composer (corelli, 1653, 1713).
composer (copland, 1890, 1990).

% composer X is a contemporary of composer Y is the range of years during which they were alive overlap

contemporary (X,Y) :-

composer (X, B1, D1), composer (Y, B2, D2) , X \ = Y, overlap (B1, D1, B2, D2).

overlap (B1, D1, B2, D2). :- B2 >= B1, B2 =< D1.
overlap (B1, D1, B2, D2). :- B1 >= B2, B1 =< D2.

alive_during (Composer, Year) :-

composer (Composer, B1, D1), overlap (B1, D1, Year, Year).


a. Use the program to find all contemporaries of Bach, Verdi, and Copeland.

b. The Baroque era of classical music extends from 1600 to 1750. Write a predicate baroque/1, i.e., executed as baroque(X) where X is a particular name, that determines whether that composer belongs to the baroque era or not.) Prolog will answer “yes” or “no”. The predicate uses the database of composers shown above.



Thank you
Mohamed Shahabudeen
Reputation Points: 10
Solved Threads: 0
Unverified User
ADeen02 is offline Offline
5 posts
since Jun 2008
Jun 5th, 2008
0

Re: Mohamed Shahabudeen in need of help!

What language is this? Your post looks like homework.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Jun 5th, 2008
0

Mohamed Shahabudeen in need of help!

the language is prolog. It is not homework but a brain teaser!

If you can help me, I would greatly be in gratitude.

[QUOTE=Ancient Dragon;621335]What language is this? Your post looks like homework
Reputation Points: 10
Solved Threads: 0
Unverified User
ADeen02 is offline Offline
5 posts
since Jun 2008
Jun 5th, 2008
0

Re: Mohamed Shahabudeen in need of help!

Sorry, I can't help you because I don't know the first thing about that language. That would be pretty easy to write in other languages such as C, C++ or VB.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005
Jun 5th, 2008
0

I Mohamed Shahabudeen will help someone grealtly if he/she helps me solve my Prolog!

I Mohamed Shahabudeen will help someone grealtly if he/she helps me solve my Prolog problem below!




Enter the following program called “composers.pro”

% This database is about composers
% Datarecords: composer’s last name, birth and death year

composer (monteverdi, 1567, 1643).
composer (bach, 1685, 1750).
composer (vivaldi, 1678, 1741).
composer (mozart, 1756, 1791).
composer (haydn, 1732, 1809).
composer (beethoven, 1770, 1827).
composer (kreisler, 1875, 1962).
composer (salieri, 1750, 1825).
composer (sammartini, 1700, 1775).
composer (scarlatti, 1660, 1725).
composer (schubert, 1797, 1828).
composer (schumann, 1810, 1856).
composer (tchaikovsky, 1840, 1893).
composer (brahms, 1833, 1897).
composer (verdi, 1813, 1901).
composer (debussy, 1862, 1918).
composer (stravinksy, 1882, 1971).
composer (wagner, 1813, 1883).
composer (chopin, 1810, 1849).
composer (corelli, 1653, 1713).
composer (copland, 1890, 1990).

% composer X is a contemporary of composer Y is the range of years during which they were alive overlap

contemporary (X,Y) :-

composer (X, B1, D1), composer (Y, B2, D2) , X \ = Y, overlap (B1, D1, B2, D2).

overlap (B1, D1, B2, D2). :- B2 >= B1, B2 =< D1.
overlap (B1, D1, B2, D2). :- B1 >= B2, B1 =< D2.

alive_during (Composer, Year) :-

composer (Composer, B1, D1), overlap (B1, D1, Year, Year).


a. Use the program to find all contemporaries of Bach, Verdi, and Copeland.

b. The Baroque era of classical music extends from 1600 to 1750. Write a predicate baroque/1, i.e., executed as baroque(X) where X is a particular name, that determines whether that composer belongs to the baroque era or not.) Prolog will answer “yes” or “no”. The predicate uses the database of composers shown above.



Thank you
Mohamed Shahabudeen[/QUOTE]
Reputation Points: 10
Solved Threads: 0
Unverified User
ADeen02 is offline Offline
5 posts
since Jun 2008
Jun 5th, 2008
0

Re: Mohamed Shahabudeen in need of help!

Instead of just begging someone to write your program for you why don't you try to do it and post what you have done, then ask specific questions about that you don't understand.

And stop posting the same question over and over and over and over ...
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Ancient Dragon is offline Offline
21,953 posts
since Aug 2005

This thread is solved

Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Legacy and Other Languages Forum Timeline: Mathematical Logic Question
Next Thread in Legacy and Other Languages Forum Timeline: QBasic, what can i do to make my programs run without the QBasic program?





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC