Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Help with these two errors In file included from guess.cpp:2:0: yesno.h:5:1: err

ID: 3714049 • Letter: H

Question

Help with these two errors

In file included from guess.cpp:2:0:
yesno.h:5:1: error: ?g? does not name a type
g>
^
guess.cpp:15:1: error: expected initializer before ?ccbool?
ccbool doGuesses (int low, int high)
^

#include <iostream>
#include "yesno.h"
#include <fstream>
#include <string>
#include <ostream>

using namespace std;
int main ()
//
// Try to guess a number beween low and high (exclusive)
// by asking a series of "Is it bigger than X?" questions.
// Return true if able to guess it. Return false and complain   
// if person's responses are inconsistent.

ccbool doGuesses (int low, int high)
{
if (low >= high)

{
cout << "Hey, no cheating! There is no number that is " << ;
return false;
}
else if (high == low + 2)
{
cout << "I'm guessing that your number is " << low+1 << endl;
cout << "Is that right? " << flush;

string response;

______________________________________________________________________________

File Edit Options Buffers Tools C++ Help
#ifndef YESNO_H
#define YESNO_H
#include <yesno.h>
#include <string>
using namespace std;


// Return true if response is "yes", "y", or any upper/lowercase
// variant of those two strings.
bool yesNo (std::string response);


#endif

Explanation / Answer

Change the return type of the method doGuesses to bool instead of ccbool Remove the #include statement from your yesno.h file
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote