sábado, 24 de noviembre de 2012

PROGRAMA PARA CALCULAR EL TOTAL A PAGAR POR UNA COMPRA


#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
char opcion='s';
float tc,desc;
char nombre[30];
while(opcion=='s')
{
textcolor(5);
textbackground(8);
clrscr();
gotoxy(10,2);cout<<"CALCULAR EL TOTAL A PAGAR POR UNA COMPRA ";
gotoxy(10,4);cout<<"ingrese total de la compra";
gotoxy(40,4);cin>>tc;
if(tc>1000)
{
desc=tc*0.20;
gotoxy(12,9);cout<<"su descuento es del 20% ";
gotoxy(12,10);cout<<"el total a pagar por la compra es: "<<desc;
}
else
{
desc=tc;
gotoxy(12,9);cout<<" usted no tiene descuento en su compra ";
gotoxy(12,10);cout<<"el total a pagar por la compra es: "<<desc;
}
do{
gotoxy(13,12);cout<<"desea registrar otra compra s/n" ;
opcion=getch();
}while((opcion!='s')&&(opcion!='n'));
}
}

No hay comentarios:

Publicar un comentario