Hi I am trying to do a game to children so they can notice the difference between to images and study how their memory atention etc are.
I want to open the image, and make a questionair where I say if the child was able to find one two three four or five differences. I also want to make a timing to know how much time they had to take until realise the differences. Can you please help me? This is the code that I have until now.

#include <ctime>
#include <cstdlib> 
#include <string>
#include <iostream> /* to open the image */
#include <fstream> 
#include <iostream> /* to count the time taken to find out what the differences are*/
#include <stdio.h>
#include <time.h>


using namespace std;

/*int main (){

    int number; 
        int time; 

}*/

/*cout << "There are six differences between these two pictures. What are them?";*/

int main()

{

    std:: string a = "A";
    std:: string b = "B";
    std:: string c = "C";
    std:: string d = "D";
    std:: string e = "E";
    std:: string f = "F";
    std:: string g = "G";
    bool run1 = true; /*repeat the question*/

    int number; /*declaration of the variable number*/
    int duration; /*declaration of the variable time*/
    int answer; /* declaration of the variable answer*/
    int one;
    int two;
    int three;
    int four;
    int five;
    int six;


    std::cout << "There are six differences between these two pictures. What are them?";

While (run1==true)
{

clock_t startTime = clock();

std::cout <<"How many correct differences?";

cout <<" A) Zero" << endl;

cout << "B) One" << endl;

cout << "C) Two" << endl;

cout << "D) Three" << endl;

cout << "E) Four" << endl;

cout << "F) Five" << endl;

cout << "G) Six" << endl;


 std::cin >> number;
std::cout<< "The number of differences found was " << number  << std:: endl;



/*clock_t endTime = clock();
duration = endTime - startTime;
double timeInSeconds = clockTicksTaken / (double) CLOCKS_PER_SEC;*/


            if (number == 'a' || number == 'A')

{

        number=0;

cout << "duration=5 minutes"
     << "number of differences=0"<<endl;

          }

           if (number == 'b' || number == 'B')
           {
            number =number+1;

cout << "duration=5 minutes"
     <<"number of differences=1"<<endl;

           }

             if (number == 'c' || number == 'C')
             {

             number = number+1;

cout << "duration=5 minutes"
     <<"number of differences=2"<<endl;

          }

              if (number == 'd' || number == 'D')
             {

                number= number+1;

cout << "duration=5 minutes"
     <<"number of differences=3"<<endl;

          }

              if (number == 'e' || number == 'E')
             {

           number=number+1;

cout << "duration=5 minutes"
     << "number of differences=4"<<endl;

          }

              if (number == 'f' ||number == 'F')
             {
                number=number+1;

cout << "duration=5 minutes"
     << "number of differences=5"<<endl;

          }             
              if (number == 'g' || number == 'G')
             {
                number=number+1;

cout << "duration=5 minutes"
     <<"number of differences=6"<<endl;

          }

           else
           {

             clock_t endTime = clock();
             duration = endTime - startTime;
             /*double timeInSeconds = clockTicksTaken / (double) CLOCKS_PER_SEC;*/

             return 0;
         }

        cout << endl;
    }
        }; 
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.