stopping

hello im having trouble finding how to stop the program , i need the program to stop one the user presses "X".

code:
#include<iostream>
#include"110ct.h"
#include<string>
using namespace std;

int main()
{
ColourController cl;
CursorController crs;

string A;
char movement;
int x
double xval ,yval;
xval= 20;// the set x postion coordinates
yval = 20;//the set x postion coordinates


//crs.setPosition(xval,yval);

//cl.setBackground(Yellow);// will set the background to yellow
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys

cl.setForeground(Aqua);
cout <<" Please enter a character to move please \n";
cin >> A;// the character the user wants to move
//crs.setPosition(xval,yval);

cout << " now you can start to move your character \n";
qin >> movement;// this will allow the user to move the character chosen

while( movement =='i')
{
yval=yval-0.5;
crs.setPosition(xval,yval);
cout << A <<"\n";
qin>>movement;
crs.clearAll();
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys

}
while( movement == 'k')
{
yval=yval+0.5;
crs.setPosition(xval,yval);
cout << A <<"\n";
qin>>movement;
crs.clearAll();
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys

}
while( movement == 'j')
{
xval=xval-0.5;
crs.setPosition(xval,yval);
cout << A <<"\n";
qin>>movement;
crs.clearAll();
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys

}
while( movement == 'l')
{
xval=xval+0.5;
crs.setPosition(xval,yval);
cout << A <<"\n";
qin>>movement;
crs.clearAll();
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys
}

qin>> movement;
cout<< " to move the special character press the following keys \n";
cout<< " press i for up \n k for down \n j for left and l for right \n";// intructions for the keys

qin.get();


return 0;
}
Topic archived. No new replies allowed.