sábado, 24 de noviembre de 2012

PROGRAMA PARA CALCULAR EL PRECIO TOTAL DE SU COMPRA

UNA TIENDA  OFRECE UN  DESCUENTO DEL 15%  SOBRE EL TOTAL DE LA COMPRA Y UN CLIENTE DESEA SABER CUANTO PAGARA FINALMENTE POR SU COMPRA. ESTA REALIZADO EN LENGUAJE C++.

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
void main (void)
{
textcolor(6);
textbackground(7);
clrscr();
float p1,p2,p3,p4,precio,desc,tpagar;
gotoxy(12,2);printf("CALCULAR PRECIO TOTAL");
gotoxy(10,4);cout<<"ingrese el precio del primer articulo ";
cin>>p1;
gotoxy(10,6);cout<<"ingrese precio del segundo articulo ";
cin>>p2;
gotoxy(10,8);cout<<"ingrese precio del tercer articulo ";
cin>>p3;
gotoxy(10,10);cout<<"ingrese precio del cuarto articulo ";
cin>>p4;
precio=p1+p2+p3+p4;
desc=precio*0.15;
tpagar=precio-desc;
gotoxy(10,14);cout<<"el 15% de descuento de su compra es: "<<desc;
gotoxy(10,16);cout<<"el total a pagar por la compra es: "<<tpagar;
getch();
}

No hay comentarios:

Publicar un comentario