//-----------------------------------------------------------------------
// IMPLEMENTATION FILE item.cpp 
//
// Implements: class item (to begin assign 11)
//-----------------------------------------------------------------------
#include "item.h"
#include "ourstr.h"
#include <iostream.h>

  item::item(string ans, int wt)
  // POST: Initializes a drill item with a spelling word
  // in answer and weight used to pick words according to success
  {
	  answer=ans;
	  Weight=wt;
  }

  int item::quiz(int time)
  // POST: Clear the screen, present this word, and after a
  //       short delay clear the screen and wait for the users
  //       input if it matches return TRUE else FALSE.
  //	   Return -1 if the user types "exit"
  //	   as time increases the delay is longer
  {
  string guess;
  cout << "Try number " << time << " for " << answer << endl;
  cin >> guess;
  if (guess=="exit") return -1;
  else if (guess==answer) return 1;
   return 0;
  }

  int item::weight()
  // POST: Return the value of weight for this item
  {
	return Weight;
  }

  void item::adjustOk(int & tot)
  // POST: Adjust the total weight passed in for this word answered
  // 	correctly tot = tot - weight + weight/2 + 1; weight=weight/2 + 1
  {
  }

  void item::adjustBad(int & tot)
  // POST: Adjust the total weight passed in for this word answered
  // 	incorrectly tot = tot + 20; weight=weight + 20
  {
  }




