Jubecron Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Jubecron Forum

The JUBECRON forum - Jamaican Chat, Dating, Games, Anime, and just meeting people.
 
HomePortalSearchLatest imagesRegisterLog in

 

 Prolog Lab 5

Go down 
2 posters
AuthorMessage
Beezle
Elite Member
Elite Member
Beezle


Female
Number of posts : 547
Age : 34
Mood : Prolog Lab 5 Breezy
Points : 253
Registration date : 2008-03-02

Character sheet
Weapon: Chakrams
Class: Ninja Ninja
HP:
Prolog Lab 5 Left_bar_bleue50/50Prolog Lab 5 Empty_bar_bleue  (50/50)

Prolog Lab 5 Empty
PostSubject: Prolog Lab 5   Prolog Lab 5 Icon_minitimeTue Oct 19, 2010 7:45 pm

% Author: Claudia-Ann Gray 0702011
% Date: 10/5/2010

accept:-write('Enter Name: '), nl, read(Name), write(Name).


atom_length(Arg1, Arg2). %returns length of Arg1 into Arg2

integer(Arg). %tests if Arg is integer returns true or false

Arg1 mod Arg2 %mod returns the remainder of deviding Arg1 by Arg2
Back to top Go down
PAPoUCH
Super Elite Lv2: Jr. Vet
Super Elite Lv2: Jr. Vet
PAPoUCH


Male
Number of posts : 1860
Age : 37
Mood : Prolog Lab 5 Sunshine
Points : 298
Registration date : 2007-10-12

Character sheet
Weapon: Crowbar
Class: Thief Thief
HP:
Prolog Lab 5 Left_bar_bleue50/50Prolog Lab 5 Empty_bar_bleue  (50/50)

Prolog Lab 5 Empty
PostSubject: Re: Prolog Lab 5   Prolog Lab 5 Icon_minitimeTue Oct 19, 2010 7:51 pm

% Author: Kevin Stewart
% Date: 10/5/2010


calc_salary :- write('Enter Salary: '), nl, read(Sal), calc_tax(Sal, Tax), disp_net(Sal, Tax).

calc_tax(Sal, Tax):- (Sal >0 , Sal < 5001 -> Tax is Sal * 0.15; (Sal <10001 -> Tax is Sal * 0.18; (Sal < 20001 -> Tax is Sal * 0.2; (Sal > 20000 -> Tax is Sal *0.25)))).

disp_net(Sal, Tax):- Net is Sal - Tax, write('Net Salary: '), write(Net).
Back to top Go down
http://www.penngosquad.forumotion.com
Beezle
Elite Member
Elite Member
Beezle


Female
Number of posts : 547
Age : 34
Mood : Prolog Lab 5 Breezy
Points : 253
Registration date : 2008-03-02

Character sheet
Weapon: Chakrams
Class: Ninja Ninja
HP:
Prolog Lab 5 Left_bar_bleue50/50Prolog Lab 5 Empty_bar_bleue  (50/50)

Prolog Lab 5 Empty
PostSubject: Re: Prolog Lab 5   Prolog Lab 5 Icon_minitimeTue Oct 19, 2010 7:54 pm

Oh yh! I didn't write that in the editor because it was on the paper.
Back to top Go down
Sponsored content





Prolog Lab 5 Empty
PostSubject: Re: Prolog Lab 5   Prolog Lab 5 Icon_minitime

Back to top Go down
 
Prolog Lab 5
Back to top 
Page 1 of 1
 Similar topics
-
» Prolog Lab 2
» prolog lab 3
» Prolog Lab 1
» Prolog Exercise 1
» Prolog Exercise 3

Permissions in this forum:You cannot reply to topics in this forum
Jubecron Forum :: School :: Schools (General)-
Jump to: