Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.91 KB | None | 0 0
  1. :- dynamic course/6, year/1, sem/1, code/1, prereq/4, credit_t/3, courselist/7.
  2.  
  3. course(1,1,'TMF1414','Introduction to Programming',4,'None').
  4.  
  5. course(1,1,'TMF1814','Discrete Mathematics',4,'None').
  6.  
  7. course(1,1,'TMF1014','System Analysis and Design',4,'None').
  8.  
  9. course(1,2,'TMF1874','Mathematics For Computing',4,'None').
  10.  
  11. course(1,2,'TMF1254','Communcation and Computer Network',4,'None').
  12.  
  13. course(1,2,'TMF1434','Data Structure and Algorithms',4,'TMF1414,TMF1814').
  14.  
  15. consult:-
  16. write('Which year are you in?'),
  17. read(Year),nl,
  18. write('Which semester are you in?'),
  19. read(Sem),course(Year,Sem,_,_,_,_),nl,
  20. write('Welcome to '),
  21. write('Year: '),write(Year),
  22. write(' Semester:'),write(Sem),nl,nl,
  23. credit_t(Year,Sem,TotalCredit),write(TotalCredit),nl;menu.
  24.  
  25.  
  26. credit_t(Year, Sem, TotalCredit):-
  27. courselist(course,Year, Sem, _,_,Credit,_),
  28. sumlist(Credit,TotalCredit);
  29. write('Total credit you need to take for this year is ').
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement