Matrices 003
-
Upload
oscarin696 -
Category
Documents
-
view
214 -
download
0
description
Transcript of Matrices 003
Ejercicio001***********Se desea realizar una proyeccion del estado del tiempo (temperatura ambiental)para los proximos 15 dias generando aleatoriamente temperaturas enteras minimas y maximas de tal forma que la temperatura del dia sea el promedio de estas. Estadisticamente se sabe que las temperaturas estn en el rango de 6 y 40.
EN EL AMBIENTE GENERAL DE LA APLICACINpublic class E001 extends javax.swing.JFrame {//Declara constantesfinal int numdias=15;final int vini=6;final int vfin=40;//Declarar Arreglosint tmin[] = new int[numdias];int tmax[]=new int[numdias];double tprom[]=new double[numdias];
CODIGO EN LOS BOTONES private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { generar(); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { proyeccion(); }GENERANDO LOS METODOS
public void generar(){ generartemperaturaminimamaxima(); calculartemperaturapromedio(); mensajegeneraciontemperatura();}public void generartemperaturaminimamaxima(){ for (int dia=0;dia