CyberSlug Rules!

Beginner Programming CMPS060

Prof. Paulo Franca

Home

Syllabus

Login

Objects

Download

Staff only

#include "franca.h"

// c5circ1.cpp

// This program draws circles on the screen

// at locations specified by the user.

//

void mainprog()

{

Box coordx("X:"),coordy("Y:"); // use boxes for
// x and y coordinates
int x,y; // declare coordinates
Circle mycircle; // declare a circle
do
{
x=ask("Enter x coordinate:");
y=ask("Enter y coordinate:");
mycircle.place(x,y); // put circle in place
mycircle.show(); // show the circle
coordx.say(x); // write coordinates
// in boxes
coordy.say(y);
}
while (yesno("Wanna try again?"));

}