Sie sind auf Seite 1von 9

COLEGIO: TECNICO AGROINDUSTRIAL “MORASPUNGO”

NOMBRE: ALEXANDRA SALAZAR

CURSO: QUINTO INFORMATICA

PROFESOR: LCDO. FREDY CARAGUAY

TRABAJO DE LENGUAJE ESTRUCTURADO


1.- Realizar un programa para ingresar 3 precios de varios productos, calcular el subtotal, el
12% de IVA y el total a pagar, presentar sus resultados.

#include<stdio.h>

#include<conio.h>

float b,x,c,sub,iva,tp;

main()

clrscr();

printf("\n Ingrese Precio1 ");scanf("%f",&b);

printf("\n Ingrese Precio2 ");scanf("%f",&x);

printf("\n Ingrese Precio3 ");scanf("%f",&c);

sub=b+x+c;

iva=sub*0,12;

tp=sub+iva;

printf("\n El subtotal es %2.f",sub);

printf("\n El iva es %2.f",iva);

printf("\n El total a pagarr es %2.f",tp);

getch();
}

2.- Realizar un programa para ingresar 4 notas de un estudiante y calcular su promedio final,
presentar sus respuestas.

#include<stdio.h>
#include<conio.h>
int n1,n2,n3,n4,t,p,x,n,s,mb,b,r,i;
char est,mat;
main()
{clrscr();

printf("CUANTOS ESTUDIANTES DESEA INGRESAR; ");scanf("%d",&n);


for(x=1;x<=n;x++)
{
printf("\n\n ESTUDIANTE: ");scanf("%s",&est);
printf("\n MATERIA: ");scanf("%s",&mat);
printf("\n NOTA 1: "); scanf("%d",&n1);
printf("\n NOTA 2: "); scanf("%d",&n2);
printf("\n NOTA 3: "); scanf("%d",&n3);
printf("\n NOTA 4: "); scanf("%d",&n4);
t=n1+n2+n3+n4;

p=t/4;

printf("\n\t TOTAL: %d",t);


printf("\t PROMEDIO: %d",p);
}
getch();
}

3.- Escribir un programa para ingresar 3 valores enteros y realizar las 4 operaciones básicas,
presentar sus resultados.

#include<stdio.h>
#include<conio.h>
int x,n1,n2,n3,s,m,r;
float d;
main()
{clrscr();

printf("\n INGRESE EL VALOR 1 ");scanf("%d",&n1);


printf("\n INGRESE EL VALOR 2 ");scanf("%d",&n2);
printf("\n INGRESE EL VALOR 3 ");scanf("%d",&n3);

s=n1+n2+n3;
r=(n1-n2)-n3;
m=(n1*n2)*n3;
d=n1/n2/n3;

printf("\n LA SUMA DE LOS VALORES INGRESADOS ES: %d",s);


printf("\n LA RESTA DE LOS VALORES INGRESADOS ES: %d",r);
printf("\n LA MULTIPLICACION DE LOS VALORES INGRESADOS ES: %d",m);
printf("\n LA DIVISION DE LOS VALORES INGRESADOS ES: %f",d);
getch();
}

4.- Dada una cantidad en centímetros convertir a su equivalente en metros, yardas, pulgadas y
pies; tomando en cuenta que:

. 1 metro=100cm
. 1 pulgada=3cm
. 1 pie=12 pulgadas
. 1 yarda=3 pies
Realizar un programa efectuar los cálculos y presentar los metros, pulgadas, pies,
yardas y centímetros.

#include <stdio.h>
#include <conio.h>
#include <dos.h>
main()
{
int op;
float n, mts,plg,pie,yardas,cm;
do{
clrscr();
printf("CONVERSIONES");
printf("\n 1. CONVERTIR A METROS");
printf("\n 2. CONVERTIR A PULGADAS");
printf("\n 3. CONVERTIR A PIES");
printf("\n 4. CONVERTIR A YARDAS");
printf("\n 5. SALIR");
printf("\n Elija una opcion: ");scanf("%d",&op);

switch (op){
case 1:
clrscr();
printf("\n CONVERSION DE CMS A METRO");
printf("\n INGRESE UNA CANTIDAD");scanf("%f",&n);
mts=n/100;
printf("\n EL VALOR CONVERTIDO A METROS ES %.2f",mts);
printf("\n Pulse cualquier tecla...");getch();
break;

case 2:
clrscr();
printf("\n CONVERSION DE CMS A PULGADAS");
printf("\n INGRESE UNA CANTIDAD");scanf("%f",&n);
plg=n/3;
printf("\n EL VALOR CONVERTIDO A PULGADAS ES %.2f",plg);
printf("\n Pulse cualquier tecla...");getch();
break;

case 3:
clrscr();
printf("\n CONVERSION DE CMS A PIES");
printf("\n INGRESE UNA CANTIDAD");scanf("%f",&n);
pie=(n/3)/12;
printf("\n EL VALOR CONVERTIDO A PIES ES %.2f",pie);
printf("\n Pulse cualquier tecla...");getch();
break;

case 4:
clrscr();
printf("\n CONVERSION DE CMS A YARDAS");
printf("\n INGRESE UNA CANTIDAD");scanf("%f",&n);
yardas=(n/3)/15;
printf("\n EL VALOR CONVERTIDO A YARDAS ES %.2f",yardas);
printf("\n Pulse cualquier tecla...");getch();
break;

case 5:
printf("\n Fin del programa");delay(500); break;
default:
printf("\n Introduzca 1,2,3,4 o 5."); delay(1000);
}
} while (op !=5);
}

5.-Realizar un programa para leer una temperatura celcius y convertir a grados fahrenheit
utilizando la siguiente formula:
F=9/5 c+32

#include<stdio.h>
#include<conio.h>

float n1,f;
main()
{clrscr();

printf("\n INGRESE LA TEMPERATURA DE CELCIUS ");scanf("%f",&n1);

f=(9+n1+32)/5;

printf("\n EQUIVALENCIA EN FAHRENHEIT: % f",f);

getch();

6.- Ingresar un numero del 2 al 12 y realiza su tabla de multiplicar en el siguiente formato,


utilizando presentación de pantalla y tabulaciones.

N*1 =N
N*2 =N
N*3=N
N*4 =N
N*5 =N
N*6 =N
N*7 =N
N*8 =N
N*9 =N
N * 10 = N

#include<stdio.h>
#include<conio.h>
int x,n, prod;
main()
{
clrscr();

printf("\n INGRESE UN NUMERO: ");scanf("%d",&n);


for(x=1;x<=10;x++)
{
prod=x*n;
printf("\n %d * %d = %d",n,x,prod);
}

getch();
}

7.-Realizar lo siguiente, utilizando la presentación en pantalla y tabulaciones

Empresa: xxxxxxx
Factura Nº: 000000
Cliente: xxxxxxxxxxx
Dirección: xxxxxxxxx
Fecha: xxxxxxxx
Cant Detalle V.Unitario V.Total
N xxxxx xxxxxx xxxxxxx
N xxxxx xxxxxx xxxxxxx
N xxxxx xxxxxx xxxxxxx
Subtotal xxxxxxx
IVA 12% xxxxxxx
A Pagar xxxxxxx

Ingresar cant, detalle y precio unitario, calcular el v.total, subtotal, iva y el total a
pagar.

#include<stdio.h>
#include<conio.h>
int cant[50],a,b,x,y,c,r,z,t;
float vu[50],tot[50],vt[50],subt[50],iva[50];
char det[50],n,d;
main()
{
clrscr();
textcolor(4);
gotoxy(35,2);cprintf("F A C T U R A");

for(a=9;a<=68;a++)
{
gotoxy(a,18);printf("Í");
gotoxy(a,20);printf("Í");
gotoxy(a,32);printf("Í");
}

for(b=18;b<=32;b++)
{
gotoxy(8,b);printf("º");
gotoxy(8,18);printf("É");
gotoxy(8,20);printf("Ì");
gotoxy(8,32);printf("È");

gotoxy(18,b);printf("º");
gotoxy(18,18);printf("Ë");
gotoxy(18,20);printf("Î");
gotoxy(18,32);printf("Ê");

gotoxy(40,b);printf("º");
gotoxy(40,18);printf("Ë");
gotoxy(40,20);printf("Î");
gotoxy(40,32);printf("Î");

gotoxy(53,b);printf("º");
gotoxy(53,18);printf("Ë");
gotoxy(53,20);printf("Î");
gotoxy(53,32);printf("Î");

gotoxy(68,b);printf("º");
gotoxy(68,18);printf("»");
gotoxy(68,20);printf("¹");
gotoxy(68,32);printf("¹");
}

gotoxy(9,5);printf("Cliente");
gotoxy(9,7);printf("Direcci¢n");
gotoxy(9,9);printf("Ruc");
gotoxy(9,11);printf("Fecha");

gotoxy(10,19);printf("Cantidad");
gotoxy(25,19);printf("Detalle");
gotoxy(42,19);printf("V.Unitario");
gotoxy(58,19);printf("V.Total");
gotoxy(43,33);printf("Subtotal");
gotoxy(43,35);printf("Iva");
gotoxy(43,37);printf("Total");
for(c=41;c<=67;c++)
{

gotoxy(c,34);printf("Í");
gotoxy(c,36);printf("Í");
gotoxy(c,38);printf("Í");
}

for(d=33;d<=38;d++)
{
gotoxy(40,d);printf("º");
gotoxy(53,d);printf("º");
gotoxy(68,d);printf("º");

gotoxy(40,34);printf("Ì");
gotoxy(53,34);printf("Î");
gotoxy(68,34);printf("¹");

gotoxy(40,36);printf("Ì");
gotoxy(53,36);printf("Î");
gotoxy(68,36);printf("¹");

gotoxy(40,38);printf("È");
gotoxy(53,38);printf("Ê");
gotoxy(68,38);printf("¼");
}

gotoxy(18,5);scanf("%s",&n);
gotoxy(18,7);scanf("%s",&d);
gotoxy(18,9);scanf("%d",&r);

for(y=21;y<=21;y++)
{

gotoxy(13,y);scanf("%d",&cant[x]);
gotoxy(28,y);scanf("%s",&det[x]);
gotoxy(46,y);scanf("%f",&vu[x]);

vt[x]=cant[x]*vu[x];
subt[x]=subt[x]+vt[x];
iva[x]=subt[x]*0.12;
tot[x]=subt[x]+iva[x];
gotoxy(59,y);printf("%.2f",vt[x]);

gotoxy(59,33);printf("%.2f",subt[x]);
gotoxy(59,35);printf("%.2f",iva[x]);
gotoxy(59,37);printf("%.2f",tot[x]);

getch();
}

Das könnte Ihnen auch gefallen