hi i need a urgent help for a program that i cant make and this is :
Write a program that implements a game, to teach arithmetic to little children. The
program tests addition and subtraction. In level 1 it tests only addition of numbers less
than 10 whose sum is less than 10. In level 2 it tests addition of arbitrary one-digit
numbers. In level 3 it tests subtraction of one-digit numbers with a nonnegative
difference. Generate random problems and get the player input. The player gets up to two
tries per problem.

You're going to have to try it yourself first! Give it your best shot and let us know if you run into any particular questions.

Dave

this is my try

this is Circle Interface

class Circle: {

public:
   Circle(int newx, int newy, int newradius);
   int getRadius();
   void setRadius(int newradius);
   void draw();
   int getX();
   int getY();
   void setX(int newx);
   void setY(int newy);
   void moveTo(int newx, int newy);
   void rMoveTo(int deltax, int deltay);
   virtual void draw();

private:
   int radius;
   int x;
   int y;
};

this is Circle Implementation

#include "Circle.h"
#include <iostream>

// constructor
Circle::Circle(int newx, int newy, int newradius): Shape(newx, newy) {
   setRadius(newradius);
}

// accessors for the radius
int Circle::getRadius() { return radius; }
void Circle::setRadius(int newradius) { radius = newradius; }

// draw the circle
void Circle::draw() {
  cout << "Drawing a Circle at:(" << getX() << "," << getY() <<
      "), radius " << getRadius() << endl;
}

// constructor
Circle::Circle(int newx, int newy) {
   moveTo(newx, newy);
}

// accessors for x & y
int Circle::getX() { return x; }
int Circle::getY() { return y; }
void Circle::setX(int newx) { x = newx; }
void Circle::setY(int newy) { y = newy; }

// move the Circle position
void Circle::moveTo(int newx, int newy) {
   setX(newx);
   setY(newy);
}
void Circle::rMoveTo(int deltax, int deltay) {
   moveTo(getX() + deltax, getY() + deltay);
}

// abstract draw method
void Circle::draw() {
}

but I have done this and can't go forward :?

UPS I'm sorry i've been thinking that is another post for another program sorry after some minutes I will post the other problem :)

This article has been dead for over six months. Start a new discussion instead.