Basic Toolkit Functions

For the first lab we will need to use the following functions from the Core Tools toolkit:

Input functions

These functions display the prompt in the console window, process and verify user input, and return the input value to the caller either as a function value or inside a reference string argument.

int RequestInt(string& prompt);

double RequestDouble(string& prompt);

RequestString(string& prompt, string& destination);

 

Setting the color:

The color is composed of shades of red, green and blue. Each color has to be in the range (0, 255) inclusive.

void SetForeColor(short red, short green, short blue);

void SetPenColor(short red, short green, short blue);

 

Painting geometric shapes:

For rectangles and ovals caller specifies the coordinates of the left, top, right, and bottom edge. For circle the caller specifies the coordinates of the center and the radius.

 

void PaintRect(int x1, int y1, int x2, int y2);

void InvertRect(int x1, int y1, int x2, int y2);

void FrameRect(int x1, int y1, int x2, int y2);

void EraseRect(int x1, int y1, int x2, int y2);

 

void PaintOval(int x1, int y1, int x2, int y2);

void InvertOval (int x1, int y1, int x2, int y2);

void FrameOval (int x1, int y1, int x2, int y2);

void EraseOval (int x1, int y1, int x2, int y2);

 

void PaintCircle(int xcenter, int ycenter, int radius);

void InvertCircle(int xcenter, int ycenter, int radius);

void FrameCircle(int xcenter, int ycenter, int radius);

void EraseCircle(int xcenter, int ycenter, int radius);