Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download

CSC112 Spring 2016 Examples

2370 views
1
// A little class to draw a rectangle on the screen
2
/*
3
########################
4
# #
5
# #
6
# #
7
########################
8
*/
9
#ifndef RECTANGLE_H
10
#define RECTANGLE_H
11
12
#include "shape.h"
13
14
class rectangle : public shape {
15
public:
16
rectangle() { tx=ty=width=height=0; }
17
18
virtual void draw(); //draw the rectangle
19
virtual void getUserParameters(int firstLine);
20
21
protected:
22
int tx, ty; //top left cooridinate
23
int width;
24
int height;
25
};
26
27
#endif
28
29