hacer un programa que le hasta 30 edades y reporte  la mayor edad y la menor edad y el preomedio de edades.

hacer un programa que le hasta 30 edades y reporte  la mayor edad y la menor edad y el preomedio de edades.

codigo:

import java.io.*;
public class Vecto {

    /**
     * @param args
     */
    public static void main(String[] args) throws IOException {
       
        int edades[] =new int [30];
        int n=0, suma=0, cmay=0, cmen=0;
        do{
            System.out.println("");
            n=leerEntero("ingrese el numero de edades: ");            
        }while(n<0 || n>30);
        for( int i=0; i...........

otro codigo:

import java.io.*;
public class Vector {

    /**
     * @param args
     */
    public static void main(String[] args) throws IOException {
       
        int edades[] =new int [30];
        int n=0, suma=0, catnmay=0, cmen=0;
        do{
            System.out.println("");
            n=leerEntero("ingrese el numero de edades: ");           
        }while(n<0 || n>30);
        for( int i=0; i

 

 

ejercicio N° 02 ingresar N notas en un arreglo ( como maximo 60 ) y calcular la nota mayor y la nota menos
menor

codigo:

import java.io.*;
public class AliYrOY {

    /**
     * @param args
     */
    public static void main(String[] args) throws
    IOException
    {BufferedReader br=new BufferedReader (new
            InputStreamReader(System.in));
    int n=0,cmen=0;
    int[] Notas=new int[60];
    System.out.println("ingrese la cantidad de notas");
    do{
        n=Integer.parseInt(br.readLine());
    }while(n<0 || n>60);
    for(int i=0;i

 Ejercicio N° 03 N numeros en un arreglo (maximo 100) luego imprimir cuantos son ceros, cuantos son negativos, cuantos positivos.
 imprimir ademas la suma de los negativos y la suma de los positivos

me falto cambiar notas por cantidad de numeros....pero es lo de menos

 

 

codigo:

import java.io.*;
public class AliYrOY {

    /**
     * @param args
     */
    public static void main(String[] args) throws
    IOException
    {BufferedReader br=new BufferedReader (new
            InputStreamReader(System.in));
    int n=0,cNumNeg=0,cNumPos=0;
    int[] Num=new int[100];
    System.out.println("ingrese la cantidad de notas");
    do{
        n=Integer.parseInt(br.readLine());
    }while(n<0 || n>100);
    for(int i=0;i

ejercicio 04 Ingresar N números en un arreglo (como máximo 50), elevar al cuadrado
cada valor almacenado en el arreglo y almacenar el resultado en otro arreglo.
 Imprimir el arreglo original y el arreglo resultante.

 

 

codigo:

import java.io.*;
public class AliYrOY {

    public static void main(String[] args) throws
    IOException
    {BufferedReader br=new BufferedReader (new
            InputStreamReader(System.in));
    int n=0,cmen=0;
    int[] Num=new int[50];
    System.out.println("ingrese la cantidad de Numeros");
        do{
        n=Integer.parseInt(br.readLine());
        }while(n<0 || n>50);
    for(int i=0;i

 

 

 

Tema: vectores

vectores y arreglos

roy | 12.07.2011

https://aprendiendofx.webnode.es/programacion/vectores/