I cant get this program compiled !!!!!

Reply

Join Date: Apr 2007
Posts: 1
Reputation: n3zor is an unknown quantity at this point 
Solved Threads: 0
n3zor n3zor is offline Offline
Newbie Poster

I cant get this program compiled !!!!!

 
0
  #1
Apr 29th, 2007
An island has two kinds of inhabitants:
Knights: Always tell the truth
Knaves: Always Lie
You encounter two people A and B. You ask the user to enter what A and B say. Your program
should output the conclusions (if possible) about the identities of A and B.
For example (done in class):
-----------------------------------------------------------------
-----------------------------------------------------------------
Solving the ISLAND PUZZLE program
-----------------------------------------------------------------
-----------------------------------------------------------------
Please enter what A says: B is a knight
Please enter what B says: The two of us are of opposite types
-----------------------------------------------------------------
-----------------------------------------------------------------
The result that we can conclude is:
A is a knave
B is a knave
-----------------------------------------------------------------
-----------------------------------------------------------------
Some answers you MIGHT expect from the user concerning what A and B say are:
1- Nothing (i.e. one of them simply says nothing)
2- At least one of us is a knave
3- At least one of us is a knight
4- We are both knights
5- We are both knaves
6- A is a knave
7- B is a knave
8- A is a knight
9- B is a knight
10- I am a knight
11- I am a knave
Reply With Quote Quick reply to this message  
Join Date: Nov 2004
Posts: 6,143
Reputation: jwenting is just really nice jwenting is just really nice jwenting is just really nice jwenting is just really nice 
Solved Threads: 212
Team Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: I cant get this program compiled !!!!!

 
0
  #2
Apr 30th, 2007
that's not a program, that's the assignment for your homework.
First you have to write a program before you can compile it.
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



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

©2003 - 2009 DaniWeb® LLC