sábado, 24 de noviembre de 2012

PROGRAMA PARA CALCULAR EL 15% DE DESCUENTO SOBRE EL TOTAL DE LA COMPRA

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main (void)
{
char opcion='s';
float tc,desc,tpagar;
while (opcion=='s')
{
textcolor(6);
textbackground(8);
clrscr();
gotoxy(12,4);cout<<"CALCULAR PRECIO TOTAL A PAGAR  EN UNA TIENDA";
gotoxy(12,8);cout<<"digite el precio total de la compra";
gotoxy(49,8);cin>>tc;
desc=tc*0.15;
tpagar=tc-desc;
gotoxy(14,12);cout<<"usted tiene un descuento del 15% del total de su compra";
gotoxy(14,13);cout<<"el total a pagar por la compra es:  "<<tpagar;
do{
gotoxy(14,16);cout<<"desea registrar nuevas compras s/n ";
opcion=getch();
}while((opcion!='s')&&(opcion!='n'));
}
}

No hay comentarios:

Publicar un comentario