ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Practicarlo de Java con promedio


Enviado por   •  16 de Marzo de 2017  •  Prácticas o problemas  •  1.207 Palabras (5 Páginas)  •  136 Visitas

Página 1 de 5

1.-

#include

#include

#include

int main(void){

float x,C,H,A;

printf("Ingrese 1er número ");

scanf("%f",& x);

printf("Ingrese 2do número ");

scanf("%f",&C);

printf("Ingrese 3er número ");

scanf("%f",&H);

A=(x+C+H)/3;

printf("promedio = %f",A);

getch ();

system("pause");

return 0;

}

2.-

#include

#include

#include

main ()

{

int s;

float P,h;

do {

printf("Circulo \n");

printf("que radio tiene el circulo\n");

scanf("%f",&h);

P =(h*h)*(3.1416);

printf("el area es de %f \n",P);

printf("1.-no\n");

printf("2.-si\n");

scanf("%d",&s);

}

while(s=2 && s>1);

system("pause");

return 0;

}

3.-

#include

#include

#include

main ()

{

int s, P,h,b;

do {

printf("Rectangulo \n");

printf("ingresa la altura \n");

scanf("%d",&h);

printf("ingresa la base \n");

scanf("%d",&b);

P =(h+h)+(b+b);

printf("el area es de %d\n",P);

printf("1.-no\n");

printf("2.-si\n");

scanf("%d",&s);

}

while(s=2 && s>1);

system("pause");

return 0;

}

4.-

#include

#include

#include

#include

#include

main()

{

int SI,d,dt;

float t,AL,Desc,SM,ISR;

char nombre[50];

system ("COLOR 2E");

printf("Ingrese el nombre: ");

scanf("%s",nombre);

printf("Escribe Cuanta ganas al día\n");

scanf("%d",&SI);

printf("Escribe Cuantos días trabajas\n");

scanf("%d",&dt);

if (SI>10000)

{

printf("%s %s\n",nombre);

printf("Días =%d \n", dt);

printf("Escribe años trabajados\n");

scanf("%d",&AL);

Desc= AL*.2;

SM=SI-AL;

ISR=SM*.20;

t=SM-ISR;

printf("El total es = %f", t);

}

else

{

if(SI>3000 && SI<10000)

{

printf("%s %s\n",nombre);

printf("Días =%d \n", dt);

printf("Escribe años trabajados\n");

scanf("%d",&AL);

Desc= AL*.2;

SM=SI-AL;

ISR=SM*.16;

t=SM-ISR;

printf("El total es = %f", t);

}

else

{

if(SI<3000 && SI>50)

{

printf("%s %s\n",nombre);

printf("Días =%d \n", dt);

printf("Escribe años trabajados\n");

scanf("%d",&AL);

Desc= AL*.2;

SM=SI-AL;

ISR=SM*.14;

t=SM-ISR;

printf("El total es = %f", t);

}

else

{

if(SI==50)

{

printf("%s %s\n",nombre);

printf("Días =%d \n", dt);

printf("Escribe años trabajados\n");

scanf("%d",&AL);

Desc= AL*.2;

SM=SI-AL;

t=SM;

printf("El total es = %f", t);

}

}

}

}

system ("pause");

return 0;

}

5.-

#include

#include

#include

main ()

{

        int precio, mensualidades,Mesesauto,d;

   float t, interes;

   char nombre[50];

   system ("color 4E");

printf("Ingrese el nombre del auto: ");

scanf("%s",nombre);

printf("Ingrese su precio\n");

scanf("%d",&precio);

printf("ingrese las mensualidades\n");

scanf("%d",&mensualidades);

if (mensualidades>24)

{

Mesesauto=precio/mensualidades;

interes=mensualidades*.12;

t=interes+Mesesauto;

printf("%s %s\n",nombre);

printf("La mensualidad será de  = %f \n", t);

}

else

{

if(mensualidades<24)

{

Mesesauto=precio/mensualidades ;

printf("%s %s\n",nombre);

printf("El total es = %d", Mesesauto);

}

}

system ("PAUSE");

return 0;

getch ();

}

6.-

#include

float promedio(int valores[], int cantidad) {

    int i;

    float  suma = 0.0;

    for (i = 0; i < cantidad; ++i)

        suma += valores[i];

    return suma / (float) cantidad;

}

int main() {

    int notas[10];

    char nombre[20];

    char opcion[3];

    int n, i;

    float pr=8.5;

    do {

...

Descargar como (para miembros actualizados)  txt (6.7 Kb)   pdf (52.3 Kb)   docx (16.4 Kb)  
Leer 4 páginas más »
Disponible sólo en Clubensayos.com