Mohamed Shahabudeen in need of help!

Please support our Legacy and Other Languages advertiser: Programming Forums - DaniWeb Sister Site
Thread Solved

Join Date: Jun 2008
Posts: 5
Reputation: ADeen02 is an unknown quantity at this point 
Solved Threads: 0
ADeen02 ADeen02 is offline Offline
Newbie Poster

Mohamed Shahabudeen in need of help!

 
0
  #1
Jun 5th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Mohamed Shahabudeen in need of help!

 
0
  #2
Jun 5th, 2008
What language is this? Your post looks like homework.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 5
Reputation: ADeen02 is an unknown quantity at this point 
Solved Threads: 0
ADeen02 ADeen02 is offline Offline
Newbie Poster

Mohamed Shahabudeen in need of help!

 
0
  #3
Jun 5th, 2008
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
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Mohamed Shahabudeen in need of help!

 
0
  #4
Jun 5th, 2008
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.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Join Date: Jun 2008
Posts: 5
Reputation: ADeen02 is an unknown quantity at this point 
Solved Threads: 0
ADeen02 ADeen02 is offline Offline
Newbie Poster

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

 
0
  #5
Jun 5th, 2008
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]
Reply With Quote Quick reply to this message  
Join Date: Aug 2005
Posts: 15,454
Reputation: Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute Ancient Dragon has a reputation beyond repute 
Solved Threads: 1476
Team Colleague
Featured Poster
Ancient Dragon's Avatar
Ancient Dragon Ancient Dragon is offline Offline
Still Learning

Re: Mohamed Shahabudeen in need of help!

 
0
  #6
Jun 5th, 2008
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 ...
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the Legacy and Other Languages Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC