sábado, 24 de noviembre de 2012

PROGRAMA PARA CALCULAR EL TOTAL A PAGAR POR UNAS LLANTAS

PROGRAMA PARA CALCULAR EL TOTAL QUE UNA PERSONA  DEBE  PAGAR EN UNA LLANTERIA,SI EL PRECIO DE CADA LLANTA  ES DE $800 SI SE COMPRAN MENOS DE 5 LLANTAS Y DE $700 SI SE COMPRAN 5 O MAS. ESTA REALIZADO EN LENGUAJE C++.

#include<iostream.h>
#include<stdio.h>
#include<conio.h>
void main (void)
{
char opcion='s';
float nll,tpagar;
char nombre[30];
while(opcion=='s')
{
textcolor(5);
textbackground(8);
clrscr();
gotoxy(10,2);cout<<"CALCULAR EL TOTAL A PAGAR EN UNA LLANTERIA ";
do{
gotoxy(10,4);cout<<"ingrese cantidad de llantas a comprar ";
gotoxy(50,4);cin>>nll;
if(nll<5)
{
tpagar=nll*800;
gotoxy(12,10);cout<<"el total a pagar por las llantas es: "<<tpagar;
}
else
if(nll>=5)
{
tpagar=nll*700;
gotoxy(12,10);cout<<"el total a pagar por las llantas es: "<<tpagar;
}
gotoxy(13,12);cout<<"desea registrar otra compra s/n" ;
opcion=getch();
}while((opcion!='s')&&(opcion!='n'));
}
}

No hay comentarios:

Publicar un comentario