i need this answer immediatly, because i have posted this question one week ago.
ID: 3599936 • Letter: I
Question
i need this answer immediatly, because i have posted this question one week ago. i was waiting for the answer.please send me the asnwer as soon as possible.
4. A Canadian variant of an old puzzle: A traveler in remote Quebec comes to a fork in the road and does not know which way to go to get to Chicoutimi. Henri and Pierre are two local inhabitants nearby who do know the way. One of them always tells the truth, and the other one never does, but the traveler does not know which is which. Is there a single question the traveler can ask Henri (in French, of course) that will be sure to tell him which way to go? We will formalize this problem in FOL. Assume there are only two sorts of objects in our domain: inhabitants, denoted by the constants henri and pierre; and French questions, which Henri and Pierre can answer. These questions are denoted by the following terms: a gauche, which asks if the traveler should take the left branch of the fork to get to Chicoutimi; dit.ouix,q), which asks if inhabitant x would answer yes to the French question q;Explanation / Answer
class String {
public:
String (); //Empty string
String (char); //Stirng('x')
String (const char[]); //String("abcd")
char& operator[] (int); //Accessor/Modifier
char operator[] (int) const; //Accessor
int capacity () const; //Max chars that can be stored (not including null terminator)
int length () const; //Number of char in string
String operator+ (const String&) const; //Concatenation
String& operator+= (String); //Concatenation
bool operator== (const String&) const;
bool operator< (const String&) const;
String substr (int, int) const;
int findch (int, char) const;
int findstr (int, const String&) const;
friend std::istream& operator>>(std::istream&, String&);
friend std::ostream& operator<<(std::ostream&, const String&);
private:
char str[STRING_SIZE];
};
String operator+ (const char[], const String&);
String operator+ (char, const String&);
bool operator== (const char[], const String&);
bool operator== (char, const String&);
bool operator< (const char[], const String&);
bool operator< (char, const String&);
bool operator<= (const String&, const String&);
bool operator!= (const String&, const String&);
bool operator>= (const String&, const String&);
bool operator> (const String&, const String&);
#endif
Makefile
###############################################################
# String & Oracle
#
# CS II Kent State University
# Make file for string class and testing oracle
# J. Maletic Fall 2017
#
#
###############################################################
# Variables
CPP = clang++
OPTIONS = -g -Wall -W -Wunused -Wuninitialized -Wshadow -std=c++11
# Names of your test files - add them in as you build them.
# Names must start with "test_"
MYTESTS = test_default_ctor test_c_str_ctor
#test_ctor_charArray
# Names of test files (include or exclude ones you don't want) testoracle_split
CTOR = testoracle_ctor_default testoracle_ctor_char testoracle_ctor_charArray
REL = testoracle_equal testoracle_lessThan
COPY = testoracle_ctor_copy testoracle_assign testoracle_ctor_charArray_int testoracle_ctor_int testoracle_swap_assign
OPS = testoracle_concat testoracle_subscript testoracle_len_cap testoracle_input testoracle_find_char testoracle_find_string testoracle_substring
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.