#include "ccc_win.h"
int main()
{
double val1,val2,val3,val4,tempv,ulenx,uleny,len,initx,inity;
string str1,str2,str3,str4;
str1=cwin.get_string("Enter the first label: ");
val1=cwin.get_double("Enter the first value: ");
str2=cwin.get_string("Enter the second label: ");
val2=cwin.get_double("Enter the second value: ");
str3=cwin.get_string("Enter the third label: ");
val3=cwin.get_double("Enter the third value: ");
str4=cwin.get_string("Enter the fourth label: ");
val4=cwin.get_double("Enter the fourth value: ");
if (val1>val2) tempv=val1;
else tempv=val2;
if (tempv>val3);
else tempv=val3;
if (tempv>val4);
else tempv=val4;
ulenx=tempv/18, uleny=4, initx=-9.5, inity=-8;
Point a(initx,inity), b(initx+val1/ulenx,inity), c(initx,inity+uleny);
cwin << Line(a,b) << Line(a,c);
a.move(val1/ulenx,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(-val1/ulenx,0), b.move(-(val1/ulenx-val2/ulenx),uleny),
c.move(0,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(val2/ulenx,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(-val2/ulenx,0), b.move(-(val2/ulenx-val3/ulenx),uleny),
c.move(0,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(val3/ulenx,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(-val3/ulenx,0), b.move(-(val3/ulenx-val4/ulenx),uleny),
c.move(0,uleny);
cwin << Line(a,b) << Line(a,c);
a.move(val4/ulenx,uleny);
cwin << Line(a,b) << Line(a,c);
cwin << Line(Point(initx,inity-1),Point(initx+tempv/ulenx,inity-1));
Line d(Point(initx,inity-1), Point(initx,inity-1.5));
for (int count=1; count<=7; count=count+1) cwin << d, d.move(3,0);
len=0;
for (int count=1; count<=7; count=count+1)
cwin << Message(Point(-9.5+(count-1)*3,-9.5),len+(count-1)*ulenx*3);
Point e(-8.5,-6.5), f(-8.5,-5.5);
cwin << Message(e,val1) << Message(f,str1);
e.move(0,4), f.move(0,4);
cwin << Message(e,val2) << Message(f,str2);
e.move(0,4), f.move(0,4);
cwin << Message(e,val3) << Message(f,str3);
e.move(0,4), f.move(0,4);
cwin << Message(e,val4) << Message(f,str4) <<
Message(Point(2,0),"Michael Cai");
return 0;
} |