Programas de C++ (Isves)
Programas de C++ (Isves)
PROGRAMAS
DE
C++
AO LECTIVO: 2011-2012
4) ELABORE UN PROGRAMA QUE CALCULE LA COMISION QUE DEBE RECIBIR UN VENDEDOR, SEGN LA VENTA QUE HAYA REALIZADO. SI LA VENTA ES MAYOR A $500, EL VENDEDOR DEBE RECIBIR EL 15% DEL TOTAL DE LA VENTA; CASO CONTRARIO NO HAY COMISION.
#include<stdio.h> #include<conio.h> main() { float ventot, comision; clrscr(); printf(ingrese la venta total:); scanf(%f,&ventot); if(ventot>500); { comisin=ventot*0.15; } printf(el vendedor debe recibir: %2f, comisin); getch(); }
5) ELABORE UN PROGRAMA QUE CALCULE LA COMISION QUE DEBE RECIBIR UN VENDEDOR. SI LA VENTA ES MAYOR A $500 EL VENDEDOR DEBE RECIBIR EL 15% DEL TOTAL DE LA VENTA; CASO CONTRARIO, ES DECIR SI LA VENTA ES MENOR O IGUAL QUE $500 DEBE RECIBIR EL %5
#include<stdio.h> #include<conio.h>
7) UNA TIENDA DE ARTEFACTOS ELECTRICOS PONE EN VIGENCIA EL SIGUIENTE PLAN PARA INCREMENTAR SUS VENTAS
SI LA COMPRA ES >100 >200 >250 <250 #include<stdio.h> #include<conio.h> main() { float ventot,descuento; clrscr(); printf(calculo de la venta\n); printf(ingrese la venta total:); scanf(%2f,&ventot); if(ventot<100) descuento=ventot*0.05; else if(ventot<200) descuento=ventot*0.08; else if(ventot<250) descuento=ventot*0.12; DESCONTAR EL 5% 8% 12% 15%
UN ESTUDIANTE EN LA SUMATORIA. SI LA NOTA ES MAYOR O IGUAL QUE 40 MUESTRA EL MENOR APROBADO, CASO CONTRARIO MUESTRA SUPLETORIO.
#include<stdio.h> #include<conio.h> main() { float nota; printf(ingrese la nota obtenida:); scanf(%f,¬a); if(nota>=40) printf(aprobado); else printf(reprobado);
11)BOLETA DE PAGO
COLEGIO FISCAL MIXTO QUINCE DE OCTUBRE PROGRAMA PARA OBTENER EL SALARIO NETO Y LA RETENCION DE UN EMPLEADO. EL CLCULO DE LA RETENCION SE BASA EN LAS CONDICIONES SIGUIENTES:
SI SI SI 0 < SALARIO 3000 <= SALARIO <=1500 RETENCION O% 5% 1500 <=SALARIO <=3000 RETENCION RETENCION 8%
#include<stdio.h> #include<conio.h> main() { char nombre[30]; float salario,reten,salneto; clrscr(); printf(ingrese datos del empleado\n); printf(__________________\n); printf(nombre:); gest (nombre); printf(salario:); scanf(%f,&salario); printf(__________________\n); if(salario>=1500) if(salario<=3000) reten=salario*0.05; else reten=salario*0.08; } else reten=0; salneto=salario-reten; printf(\n); printf(_______________\n); printf(boleta de pago\n); printf(nombre printf(salario :%10s\n,nombre); :%10.2f\n,salario);
12)ELABORE UN PROGRAMA PARA CALCULAR LA SUMA DE LOS NUMEROS N, UTILIZANDO LA ESTRUCTURA WHILE
#include<stdio.h> #include<conio.h> main() { int x,n,suma; clrscr(); printf(ingrese un numero entero:); scanf(%d,&n); suma=0; x=1; while(x<=n){ //acumula la suma de los nmeros 1,2,3 ,n suma=suma+x; //genera los nmeros 1,2,3,n x=x+1; }
14)ELABORE UN PROGRAMA QUE CALCULE EL PRODUCTO DE DOS NUMEROS MEDIANTE SUMAS SIN UTILIZAR EL OPERADOR(*)
#include<stdio.h>
amort=c*(i/p)*pow(1+i/p,t*p)/(pow(1+i/p,t*p)-1);